Assign and display values
python · static example
name = "Asha"
age = 19
is_student = True
print(name, age, is_student)
print(type(age).__name__)Variable names are case-sensitive. `type()` can help inspect a value while learning.
Store information in variables and recognize common Python value types.
A variable is a name that refers to a value. Common beginner types include str for text, int for whole numbers, float for decimal numbers, and bool for True or False. Python infers a value's type when you assign it.
python · static example
name = "Asha"
age = 19
is_student = True
print(name, age, is_student)
print(type(age).__name__)Variable names are case-sensitive. `type()` can help inspect a value while learning.
Asha 19 True
intLabeled sample only — nothing was run on this page.
A campus event form collects a student's name, semester number, and whether they need accessibility support.
Choose a suitable Python type for each value and explain why.
The name is text (`str`), semester is a whole number (`int`), and the support answer can be a Boolean (`bool`). Real forms also need input validation.
What is the type of `3.5`?
Pick an answer to check.