Python is an amazing and easy-to-learn programming language, especially when you use this website!
To use Python, you can either download IDLE, a Python shell, or you can use an online website. The website I use is Trinket, which I would recommend.
If you're using an app, to create a program you'll have to find "New Program" in the menus to create a program.
If you're using Trinket, you'll have to create an account, then select your username, then select New Trinket, then select Python to create a new Python program.
You may need to look online to learn how to operate your app or website.
This website contains several pages:
Eight pages that teach you to code in Python,
The "Debugging Code" page, which will explain some easy methods for debugging, and
The "How To..." page, which will explain how to create different things with Python, such as a text adventure.
I strongly recommend viewing the "Debugging Code" page, as a beginner's code will often have mistakes.
You'll find fun and easy challenges used to help you review Python skills here, under the heading of "Challenges". Each page also has a subpage called "Answers to Challenges". You'll find the answers to every challenge given in this subpage. You can also edit the code for these programs, and get the output with the "Run" button.
The "Vocabulary" heading at the end of a section contains confusing words and phrases and what they mean in the context of Python here. Words mentioned here will be in bold in the section.
You'll find extra topics to look up here, under the heading of "For Masters".
You'll find more fun challenges here. However, to understand these challenges, you'll need to have looked up and understood all of the topics mentioned in the "For Masters" challenges.
Here's an example of a code box:
print("Here's some code.")
if a == 2:
print("Here's more code.") # Runs if a == 2 is True.
See the bold text? Did you notice that it's all after the # symbol? In Python, anything after a # is ignored. This is used to add comments. In this website, comments are always shown in bold to help you recognize them.
Sometimes you'll see a comment after a print() command. The comment is just showing what Python will output. Ex:
print("Python's as easy as %s!" %(123)) # Python's as easy as 123!
Sometimes you'll also see italic numbers before each line. These are line numbers, which you should NOT type in.
After reading through this webpage, you'll even be able to understand crazy programs like this:
from turtle import *
import time as t
class New(Pen):
def square(self,size = 10):
for i in range(0,3):
self.forward(size)
self.left(90)
t.sleep(1)
turtle = New()
turtle.color("purple")
turtle.fillcolor("blue")
turtle.begin_fill()
turtle.square(50)
turtle.end_fill()