@YatinBayya (18) • Harvest Park Middle School
hi im new at python
posted to Ask by ThanhTungTung

The Basics
This is an overview of the basics to help you boost your start with python. I won't go through everything of course but enough for you to start your first application. Make sure you selected Python 3 instead of Python 2.
Variables in python are just like the ones in math but you have to define them. You can store different types of data like the ones below...
Booleans - True/False
Strings- Text
Int/Integer - Numbers with no decimal
Double - Decimals
Long - Big Number
Short - Small Number
Byte- 0-8
This is how we define each one

var myBoolean = True
var myString = "A String"
var myInt= -34
var myDouble= 43.143
var myShort = 10
var myLong =34123
var myByte = 2

The variable names are in the middle which you will need to call it... and you can name the variables anything without any special characters(!, +, #, etc)
Note: True/False in booleans MUST be capitalized
Operators is math. Done! Ok, here are the different types...
Addition - +(It adds stuff)
Subtraction- - (It subtracts stuff)
Multiplication- is the star above the 8 key (It multiplies stuff)
Division- / (It divides stuff)
*Modulus- % (It finds the remainder of an equation)
Here is the syntax

var mathNumber = 42
var password = 1234

var addition = mathNumber+password


As you can see my very AP math skills
Print Statements
The print statement is a very simple concept, all it does is display text in the terminal/console. In replit, you should see your program running on the side. Below is the syntax of the code for printing.

print("Hello World")

Whatever is in the quotes is printed so you can change it to "Creeper Aww Man" and it would work. We can also print variables like this (only if we have it defined)...


To print variables along strings you can do...

print("My Name is" + name)

Say you want to print What is your Name? and then print the user's name. To do this you would need to tell the computer you are getting there input.

name = input("What is your name?")

The code here makes a variable which you can use later to print or do something.
Note: the thing before the = sign is your variable name for pulling the data later.
If/Else Statements
What do we do when we want to check if data is equal to something... well if statements. This is the syntax to make if statements are...

if(age > 60):
        print("Sign Up for our senior program)
else if(age == 9):
        print("Greetings 9-year-old")

Note: Indentations (press tab key, NO SPACES) are REALLY important for the syntax. If it is wrong you program will crash. This is only when the line before has ":" which means it continues to the next line so you need to indent the things you want to execute when that statement is true.
This is a very small part of the programming world but I found some tutorials I think would help you out with your python coding.


Game making🎮
posted to Ask by rabofan70

Website based Games/ Canvas Games

If you want to make games on the web I would recommend learning HTML/CSS and then start learning JS when you are confident with both HTML/CSS. After you are done learning JS I would suggest looking into Canvas Games (Google It) which there are a ton of tutorials for. This is the easiest way to game development. This can get you into game development in about a month or so if you are really dedicated.

Desktop/Pc Games

This genre is a bit complicated because of the variety of choices. You can do Python which is the easiest of which. But after you are thorough with the fundamentals, basics, and intermediate level programming, I recommend starting with PyGame which is a programming library(Existing Code that you can build upon) that helps you make games. Then they are harder languages for this like Java(Which Minecraft is made in) and C++(Which pretty much all games are made in). Remember this genre will take a year or so to master.

Apple Appstore

I recommend you to use an Apple device for this one, although possible in windows. This uses a programming language called Swift. This is made by apple and there are a ton of tutorials. The syntax is very similar to Java and C++ which I rather recommend you learn one of those before you go onto Swift.

Google Play Store

The Google play store uses Java just like Desktop/Pc Games and learning this language you can do two genres in one go.

Pretty Much Everything

This is the path that I recommend, learn Unity which uses C#(Not to be confused with C++), for this learning C# is not necessary but recommended and search online for some Unity tutorials. The great part about this is that it will take a couple of months to master and this can be used for Websites, Xbox, Pc, Apple App Store, Google Play, Facebook Game Room, and much more. This is the most popular of which but it can be confusing at first so I recommend getting some programming experience before hopping on to this.

Good Luck with your game development and If this helps your question please select the checkmark next to this comment.

what did i do wrong
posted to Ask by JAGABAN

I am going to assume that you are trying to make a title as in a heading. What the title tag is not to make titles but to title the website which appears on the tab. To make a heading you need to do this

              <title> HELLO WORLD!</title>
              <h1>Hello World </h1>

Whatever you put in the body is the content of your website. And the H1 stands for heading 1. There are 6 levels of heading, h1 being the biggest and h6 being the smallest.

<h1>Hello World</h1>
<h2>Hello World</h2>
<h3>Hello World</h3>
<h4>Hello World</h4>
<h5>Hello World</h5>
<h6>Hello World</h6>

FYI: to add pargraphs which is achieved by doing html <p>CONTENT HERE</p>

I hope I was able to help if so select the checkmark next to my comment which would be greatly appreciated.

How do you change replit usernames?
posted to Ask by YatinBayya

@Zavexeon ok I will do so

Question about Python GUI automation.
posted to Ask by ndeering

Currently, the default libraries prevent you to automate the user's keyboard or mouse. Although this might be helpful, it guides you through the basics and eventually leads your question in chapter 18.

I hope that is helpful and good luck with your project. If this helps you I would appreciate if you would select this as the correct answer.

posted to Challenge by katyadee

Do the votes matter when you judge

posted to Ask by kiki2005

@kiki2005 then you have some minor errors but I fixed it for you... I recommend to compare and contrast both and implement better syntax next time

global character
print("Welcome to Password Checker")
def menu():
    print("Please enter a number that fits with one of the below.")
    print("1: Password Checker")
    print("2: Password Generator")
    print("3: Quit")
    menuSelection = int(input("..."))
    if menuSelection == 1:
        password = input("please enter a password")
        for c in password :
            if c.isspace() != True:
              character = character + 1
if character<=8:
       print ("this password is too short")
if character>=24:
       print("this password is too long")
  point = 0 
  length = len(password)
  uppers = [x for x in password if x.isupper()] 
  uppernum = len(uppers) 
  lowers = [x for x in password if x.islower()] 
  lowernum = len(lowers)
  point = point + length + (uppernum * 5) + (lowernum * 5)
posted to Ask by Zach0

Hopeflly he isnt hacking the people signed in with google cuz then he will have access to everything

hi im new at python
posted to Ask by ThanhTungTung

@ThanhTungTung My bad there is no else if there is only elif.

hi im new at python
posted to Ask by ThanhTungTung

@ThanhTungTung Your welcome. I am glad it helped it took me an hour to write it

WINNER ANNOUNCED: What would you do with $5,000?
posted to Announcements by katyadee

I would buy a water bottle.

WINNER ANNOUNCED: What would you do with $5,000?
posted to Announcements by katyadee

I mean a "non biased" $5k challenge.

WINNER ANNOUNCED: What would you do with $5,000?
posted to Announcements by katyadee

Make a rigged competition so Chandler can win something for the second time

Python Experts
posted to Ask by ArjunChandraesk

I would say there is no such thing as learning a programming language fully. Even "experts" learn from a day to day basis and there are constantly new features and libraries to explore. By that you are meaning the fundlementals it really depends on how dedicated you are. It could be one day or one year. And your struggles right now will be the way you get better at programming :)

⛈Brainstorm ⛈What should we code?
posted to Ask by katyadee

@ebest Yes, you could add Unicodes but python accepts a certain range

🎵 MusiK-it (Bespoke musical tool) 🎵
posted to Challenge by YatinBayya

@abc3354 It is not played at the same time because the audio files are different lengths therefore the timing function must play one after one.

posted to Challenge by katyadee

@katyadee that is such a relief

[JAVASCRIPT] getElementByID() is not getting all tagged elements
posted to Ask by YatinBayya

@vedprad1 but when you say getElementByClassName() it is actually a list so you need to loop through it

posted to Ask by kiki2005

If that does help click the check mark next to my answer.

posted to Ask by kiki2005

At the top of your code, it should look like this

global character 

It is because of that character only exists in the menu function therefore if you take it outside the function and make it global it can be used anywhere in your application.

Hope that helps :)