What is Python?
A beginner-friendly, high-level programming language used for apps, automation, data, AI, and more.
Does Python care about capitalization?
Yes, it is case-sensitive.
What is syntax?
The rules for how code must be written to run correctly.
What does print() do in Python?
Displays text or values in the output.
How do you make Python display hello?
print(“hello”)
What does input() do?
Takes user input and stores it as text.
What type of data does input() always return?
A string.
How do you store user input in a variable?
name = input(“Enter name: “)
What is a variable in Python?
A labeled container that stores data.
How do you assign the number 5 to a variable named x?
x = 5
What are lists in Python?
Ordered collections that can store multiple values.
How do you make a list of 3 numbers?
nums = [1, 2, 3]
Do lists start counting from 0 or 1?
0 (zero-based indexing).
How do you access the first item in a list named food?
food[0]
What is an if statement used for?
Running code only when a condition is true.
Write a basic if statement checking if x is greater than 10.
if x > 10:
print(“x is big”)
What does else do?
Runs when the if condition is false.
What is a loop?
Code that repeats automatically.
What kind of loop repeats a set number of times?
A for loop.
Write a for loop that prints 0 to 2.
for i in range(3):
print(i)
What does range(5) produce?
The numbers 0 through 4.
What loop repeats while a condition is true?
A while loop.
What symbol is used to start a code block in Python (after if, loops, functions)?
A colon :
What is indentation in Python?
Spaces at the start of a line that define code blocks.