Python
Variables & values
A practical reference with examples you can run.
Introduction
A variable gives a name to a value. Choose names that describe the information, such as score or learner_name. Assign a value before you read it, and remember that assigning again replaces the previous value.
Syntax & example
name = "Developer"
print("Hello", name)Expected output
Hello Developer
Common mistakes
- Using a variable before assigning a value to it.
- Mixing text and numbers without converting deliberately.
- Skipping an empty input or a boundary value when testing.
Practice
Create a variable for your favorite city and display it.
main.pyYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-82 lines