By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
You need to run code and store data in it. Every program starts with output and variables. Get those two things working, and you have the foundation for everything else.
Python is readable. The syntax stays close to English, which means you spend less mental energy parsing unfamiliar symbols and more time understanding what the code actually does. Instagram, Netflix and NASA use it in production, but that's not why it's good for learning. What matters is that when you read Python code six months later, it still makes sense.
The traditional starting point is 'Hello, World'. In Python, it's one line.
print("Hello, World!")The print function outputs text to the console. That's it. You've written and executed a working program.
A variable is a named container for data. You assign a value to it with the equals sign, and you can reference that value later by name. Python figures out what type of data you're storing automatically. You don't declare 'int' or 'string' like you would in Java or C++.
name = "Alice" # str
age = 25 # int
height = 5.7 # float
is_student = True # bool
print(f"Hi, I am {name}, {age} years old.")In that example, Python infers that name is a string, age is an integer, height is a float, and is_student is a boolean. The f-string syntax (the f before the quotes) lets you embed variables directly into text using curly braces. When Python executes that print statement, it substitutes the actual values.
Variable names have constraints. Use snake_case: write first_name and total_score, not firstName or totalScore. Names cannot start with a digit, so 2name is invalid. You cannot use Python keywords like if, for, or class as variable names. Names are case-sensitive, meaning name, Name, and NAME are three different variables.
Build the habit of descriptive names from day one. 'user_age' will beat 'ua' every time you come back to the code.
This is not pedantry. Code spends far more time being read than being written. A clear variable name costs nothing extra but saves debugging time later.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.