🐍 Python Beginner Notes — Step-by-Step
Illustrated Guide with Practice Workbook
🧩 1. Introduction to Python
💡 What is Python?
Python is a high-level, interpreted, general-purpose programming language that is easy to learn and
widely used across industries like Artificial Intelligence, Web Development, Automation, and Data
Science.
✨ Key Features:
• Simple, English-like syntax
• Portable across platforms
• Large standard library
• Open source and beginner-friendly
Example:
print("Hello, World!")
Output: Hello, World!
📘 2. Structure of a Python Program
Steps:
1. Write your code in a text editor.
2. Save the file with .py extension.
3. Run it in a terminal using python [Link] .
Example:
# This is a comment
print("Python is fun!")
📦 3. Variables and Data Types
Variables store values in memory.
1
name = "Vandita"
age = 15
height = 4.8
is_student = True
Type Example Description
int 10 Integer number
float 3.5 Decimal value
str "hello" String or text
bool True/False Logical value
Type Conversion:
age = int(input("Enter your age: "))
🗣️ 4. Input and Output
name = input("Enter your name: ")
print(f"Welcome, {name}!")
f-strings allow you to insert variables easily inside text.
🔣 5. Operators
Operator Meaning Example Result
+ Add 4+3 7
- Subtract 10 - 2 8
* Multiply 2*3 6
/ Divide 8/2 4.0
% Modulus 9%2 1
** Power 3 ** 2 9
⚖️ 6. Conditional Statements
Decision-making using if , elif , and else .
2
age = int(input("Enter your age: "))
if age >= 18:
print("Adult")
else:
print("Minor")
Flowchart:
Start → Input → Check condition → True → Statement 1
→ False → Statement 2 → End
🔁 7. Loops
For Loop
for i in range(1, 6):
print(i)
While Loop
i = 1
while i <= 5:
print(i)
i += 1
Flowchart:
Start → Check condition → True → Execute → Update → Repeat
↘ False → End
🍎 8. Lists
Lists store multiple items.
fruits = ["apple", "banana", "mango"]
Accessing and modifying:
3
print(fruits[0])
[Link]("grape")
[Link]("banana")
📚 9. Dictionaries
Store data as key–value pairs.
student = {
"name": "Vandita",
"age": 15,
"grade": "10th"
}
Accessing and updating:
print(student["name"])
student["school"] = "ABC High School"
🧮 PRACTICE WORKBOOK
🟢 LEVEL 1 — EASY
1. Write a program to print your name 5 times using a for loop.
2. Ask the user for a number and print whether it’s even or odd.
3. Create a list of 5 fruits and print each fruit on a new line.
4. Create a dictionary with your name, age, and hobby; print all keys and values.
5. Write a while loop to print numbers 1 to 10.
🟠 LEVEL 2 — MEDIUM
1. Write a program to display the multiplication table of a number.
2. Create a list of marks and calculate the average.
3. Take two numbers and print the greater one.
4. Create a dictionary storing 3 countries and their capitals. Let the user input a country name and
print its capital.
5. Write a program to count from 10 down to 1 using a while loop.
4
🔵 LEVEL 3 — CHALLENGING
1. Create a list of numbers and print only the even ones.
2. Write a program that asks for a password and keeps asking until the correct one is entered.
3. Build a small calculator using if conditions for +, -, *, /.
4. Create a dictionary for a student with marks in 3 subjects, calculate total and percentage.
5. Write a program to print this pattern:
*
**
***
****
*****
🎯 EXTRA CREDIT
Try to make your own: - Temperature converter (Celsius ↔ Fahrenheit) - Number guessing game -
Simple contact book using dictionaries
🧠 STUDY TIPS
• Practice 20–30 minutes daily.
• Read errors carefully — they’re your best teachers.
• Test your knowledge by explaining a topic out loud.
• Try one new small project every weekend.
🚀 NEXT CHAPTER (Tomorrow)
• Functions in Python
• Lists vs Tuples vs Sets
• Nested Loops
• Mini Projects: Calculator, Guess Game, Grade System
✨ By mastering this workbook, you’ll be ready to build real programs and understand Python
logic clearly.