Your First Python Program
What is Python?
Python is a beginner-friendly, general-purpose language used for web apps, data science, AI, automation and scripting. Code is run line by line by the Python interpreter, so there is no separate compile step.
print()
print() shows text on the screen. Text (a string) goes inside quotes, either "double" or 'single'.
Comments
Anything after # is a comment. Python ignores it, so use comments to explain why your code does something.
Indentation matters
Python uses indentation (spaces at the start of a line) to group code, where other languages use { }. The standard is 4 spaces per level. Wrong indentation causes an IndentationError.
Case sensitivity
name, Name and NAME are three different things, and Print("hi") fails because the function is print.
⚠️ Common mistakes
- Forgetting the closing quote or bracket:
print("Hello) - Mixing tabs and spaces for indentation
▶️ Runs in the app.
Example
# This is a comment — Python ignores it
print("Hello, World!")
print('Single quotes work too')
print("Python", "is", "fun") # several values are joined with spaces
# Indentation groups code into blocks
if True:
print("This line is inside the block")
print("This line is outside")
# Output:
# Hello, World!
# Single quotes work too
# Python is fun
# This line is inside the block
# This line is outside