Foundation lesson for variables and data types. Read theory first, then connect it to a real app example.
A variable is a name stuck on a value. Use the name later instead of rewriting the value.
score = 10 stores 10. print(score) reads the box.
A variable is a named storage box for data. You store a value once and reuse it later by its name.
Used to store user input, prices, names, scores, flags, and intermediate calculations in almost every program.
True/False.item_count = 2 (how many dishes), total = 18.50 (price with tax), customer = "Riya" (text), paid = False (not paid yet). Tap each box below to see how Python stores it.
Answer all questions, then click Check answers. Use this before Practice in the editor.
Q1. What is a variable?
Q2. What is the type of 18.5?
Q3. What does `paid = False` store?
Q4. Which is valid Python naming style?