Printing and Variables
Python runs each line top to bottom, with no disp or semicolons needed -- print() is how you show output.
Your first line
print("Hello, world!")
Variables
No type keyword needed -- Python figures out the type from the value you assign:
name = "Ada"
age = 20
gpa = 4.5
Getting input
name = input("What's your name? ")
print("Hello, " + name)
input() always returns a string, even if the student types a number -- convert it explicitly with int()/float() before doing math with it.
Comments
# This is a comment -- Python ignores everything after the #
Why This Matters for Your Exams
Python's lack of type declarations is exactly what makes it fast to write and read -- but it also means a typo'd variable name fails silently as a new variable instead of an error, which is the single most common beginner bug. Always double-check spelling.
Try it yourself
Change the name below and press Run to see Python's own output.
Real-time practice is a paid add-on
Reading units and the practice quiz are free. Pay once to unlock running real code for PYTHON.

