I may look like a simple teenager that just codes but I am far from that. I have made a site along with my buddy @ArgentiCityZenx to make a coding site called CodespaceMPT
This README will show you Python and by the end of the day, you'll be a begineer at coding.
Python is the easiest code language in the world. It is simple and it is friendly for all users. You will start off by going to a python editor and making a simple message. You will put print("Hello World")
into the codebox. Once you're done, the box below (aka a terminal) should say "Hello World" when you click on the Run button. You can change "Hello World" to any message or to any value, which we'll study later.
Next, you'll make a simple input message. You will write it like so:
name = input("What is your name? ")
Notice the name = input
? These will be VERY important if you want to make it print out your name. Also notice how the quote has a space. This will make it spaced and not squished likethis. Going back to printing values, you will format a value and print one like so:
year = 2024
print(year)
Do you see the fact that there aren't any quotations? if we put quotations in the brackets it would just say "year" and we don't want that do we? We want it to show what year means.
Next, we'll make it show our name when we input our name in the terminal. You'll start off as before with an input but this time we'll add print("Hello " + name)
to the code like so:
name = input("What is your name? ")
print("Hello " + name)
You can also make math too. Just do it like so:
print(2 + 2)
# Replace this math equation with your desired one.
Notice the line with a #? That is a comment. They never get executed and they always say information about the code.
We can make a message display if something happens. For example, we could make it so that if the password inputted is pythonsnake.org
it will say Access Granted.
password = input("Enter passcode: ")
if password == "pythonsnake.org":
print("Access granted")
else:
print("Access denied")
I hope you had fun learning. If this tutorial was too complex, search on YouTube a Python tutorial. Bye!