Overview
Write your first lines of Python: show text on the screen with print() and store values in variables.
- print() shows a value on the screen
- Text (str) goes inside quotes
- Whole numbers (int) have no quotes
- name = value stores a value
Short Course
print() displays whatever you put between the parentheses.
A variable
is a name that stores a value — create one with =.
Text needs quotes,
numbers don't.
print("Hi there!") # shows: Hi there!
city = "Paris" # text (str)
years = 3 # number (int)
print(city) # shows: Paris
print(years + 1) # shows: 4
Task
Replace every ___ in the editor:
- Set
nameto your name as text (in quotes). - Set
ageto a whole number. - Print exactly
Hello, Python!
Test Suites
Pending
Stdout