Python Beginner Lessons — Day
1 Summary
1. Running Your First Python Code
You learned how to run Python code using Programiz. First code:
print("Hello, Python!")
2. Variables
Variables store information.
Example:
name = "Augustine"
age = 15
3. Basic Math
Python can add, subtract, multiply, divide.
Example:
a = 10
b=3
4. If Statements
Programs make decisions using if-statements.
Example:
if age >= 18:
print("Adult")
5. For Loops
Repeat actions a set number of times.
Example:
for i in range(5):
print(i)
6. Functions
Functions are reusable blocks of code.
Example:
def greet():
print("Hello")
7. Functions with Parameters
Functions can accept input.
Example:
def greet(name):
print("Hello", name)
8. Mini Project: Simple Calculator
Your first project using input + function.
9. For Loop with Input
Program loops from 1 to user’s number.
10. While Loops
Repeats while a condition remains true.
Example:
count = 1
while count <= 5:
count += 1
Concept What You Learned
Variables Store data like names or numbers
Loops Repeat tasks automatically
Functions Reusable pieces of code