🏠 Home

Welcome to Python World!

Learn Coding Step by Step 🚀

A fun beginner programming course for young programmers
Created by Geta Ba / GETCOM

🎯 What Will You Learn Today?

🐣 Example 1: My First Addition Program

Let's teach Python how to add two numbers!

🐍 Python Code



# Example 1: Addition of Two Variables


# Give numbers to Python

a = 10
b = 20

# Ask Python to add them

total = a + b

# Show the answer

print("First Number =", a)
print("Second Number =", b)
print("Sum =", total)



🤖 Python Answer

First Number = 10

Second Number = 20

🎉 Sum = 30

⭐ Try Yourself:
Change the values of a and b. What happens?

🎓 Example 2: Student Marks Calculator

Python helps students calculate total marks and average.

🐍 Python Code




# Example 2: Three Subjects


math = 85
english = 90
science = 80

total = math + english + science

average = total / 3

print("Math =", math)
print("English =", english)
print("Science =", science)
print("Total =", total)
print("Average =", average)




🤖 Python Answer

Math = 85

English = 90

Science = 80


Total = 255

⭐ Average = 85

🎯 Coding Challenge:
Try changing the marks and calculate a new average!

🛒 Example 3: Supermarket Bill Program

Python can help shop owners calculate payments.

🐍 Python Code





# Example 3: Supermarket Bill


apple = 50
banana = 30
orange = 40



total = apple + banana + orange

tax = total * 0.15

net = total + tax



print("Apple =", apple,"Birr")
print("Banana =", banana,"Birr")
print("Orange =", orange,"Birr")
print("Total =", total,"Birr")
print("Tax =", tax,"Birr")
print("Net =", net,"Birr")




🤖 Python Answer

Apple = 50 Birr

Banana = 30 Birr

Orange = 40 Birr


Total = 120 Birr

Tax = 18 Birr

🎉 Net Amount = 138 Birr

🌟 Real Life Project:
Create your own shopping calculator!

⌨️ Example 4: Addition Using User Input

Now Python asks the user to enter numbers!

🐍 Python Code



# EXAMPLE 4: ADDITION OF TWO VARIABLES
# Using User Input


# Step 1: Get values from user

a = int(input("Enter first number: "))

b = int(input("Enter second number: "))



# Step 2: Process (Addition)

total = a + b



# Step 3: Display result

print("First Number =", a)
print("Second Number =", b)
print("Sum =", total)


🤖 Python Output

Enter first number: 8

Enter second number: 9


First Number = 8

Second Number = 9

🎉 Sum = 17

⭐ Challenge: Try adding three numbers instead of two!

🎓 Example 5: Student Total and Average

Python can calculate student results automatically.

🐍 Python Code



# EXAMPLE 5:
# TOTAL AND AVERAGE OF THREE SUBJECTS


# Step 1: Input marks


math = float(input("Enter Math Marks: "))

english = float(input("Enter English Marks: "))

science = float(input("Enter Science Marks: "))



# Step 2: Process


total = math + english + science

average = total / 3



# Step 3: Display result


print("\n===== RESULT =====")

print("Math Marks =", math)

print("English Marks =", english)

print("Science Marks =", science)

print("------------------")

print("Total Marks =", total)

print("Average Marks =", average)


🤖 Python Output

Enter Math Marks: 80

Enter English Marks: 75

Enter Science Marks: 90


Total Marks = 245

⭐ Average Marks = 81.67

🎯 Try Yourself: Create a program for 5 subjects.

🛒 Example 6: Supermarket Bill Calculator

Python helps shopkeepers calculate customer payments.

🐍 Python Code




# EXAMPLE 6:
# SUPERMARKET BILL USING USER INPUT



# Step 1: Input fruit prices


apple = float(input("Enter Apple Price: "))

banana = float(input("Enter Banana Price: "))

orange = float(input("Enter Orange Price: "))



# Step 2: Process


total = apple + banana + orange

tax = total * 0.15

net = total + tax



# Step 3: Display result



print("\n===== SUPERMARKET RECEIPT =====")


print("Apple Price =", apple, "Birr")

print("Banana Price =", banana, "Birr")

print("Orange Price =", orange, "Birr")


print("------------------------------")


print("Total Cost =", total, "Birr")

print("Tax (15%) =", tax, "Birr")

print("Net Amount =", net, "Birr")



🤖 Python Output

Enter Apple Price: 120

Enter Banana Price: 140

Enter Orange Price: 100


Total Cost = 360 Birr

Tax (15%) = 54 Birr

🎉 Net Amount = 414 Birr

🌟 Real Project: Create your own restaurant billing system!

🍎 Example 7: Supermarket Fruit Bill System

Create a real shopping program that calculates the cost of three different fruits.

🐍 Python Code



# EXAMPLE 7:
# SUPERMARKET FRUIT BILL


# Step 1: First fruit information


fruit1 = input("Enter first fruit name: ")

price1 = float(input("Enter price per kg: "))

kg1 = float(input("Enter kilogram: "))



# Calculate first fruit cost

cost1 = price1 * kg1





# Step 2: Second fruit information


fruit2 = input("Enter second fruit name: ")

price2 = float(input("Enter price per kg: "))

kg2 = float(input("Enter kilogram: "))



# Calculate second fruit cost

cost2 = price2 * kg2






# Step 3: Third fruit information


fruit3 = input("Enter third fruit name: ")

price3 = float(input("Enter price per kg: "))

kg3 = float(input("Enter kilogram: "))



# Calculate third fruit cost

cost3 = price3 * kg3






# Step 4: Calculate total cost


total_cost = cost1 + cost2 + cost3


tax = total_cost * 0.15


net_amount = total_cost + tax






# Step 5: Display receipt


print("\n======== FRUIT RECEIPT ========")


print(fruit1, "=", cost1, "Birr")


print(fruit2, "=", cost2, "Birr")


print(fruit3, "=", cost3, "Birr")


print("------------------------------")


print("Total Fruit Cost =", total_cost, "Birr")


print("Tax (15%)        =", tax, "Birr")


print("Net Amount       =", net_amount, "Birr")



🤖 Python Output

Enter first fruit name: Banana

Enter price per kg: 100

Enter kilogram: 2


Enter second fruit name: Orange

Enter price per kg: 50

Enter kilogram: 3


Enter third fruit name: Apple

Enter price per kg: 90

Enter kilogram: 2


Banana = 200 Birr

Orange = 150 Birr

Apple = 180 Birr


Total Fruit Cost = 530 Birr

Tax (15%) = 79.5 Birr

🎉 Net Amount = 609.5 Birr

🌟 Real Life Project:
Create a restaurant bill system with food name, quantity, price, tax, and final payment.

💬 Example 8: Simple Conversation Program (String Input)

Python can communicate with users by taking text information.

🐍 Python Code



# Simple Conversation Using String Input


name = input("🤖 Hello! What is your name? ")


age = input("🤖 How old are you? ")


city = input("🤖 Where do you live? ")




print("\n====================")

print("🐍 Python Conversation")

print("====================")




print("Hello", name, "😊")


print("You are", age, "years old.")


print("You live in", city, ".")


print("Nice to meet you! Keep learning Python 🚀")


🤖 Python Output

🤖 Hello! What is your name? Geta

🤖 How old are you? 25

🤖 Where do you live? Addis Ababa


🐍 Python Conversation

Hello Geta 😊

You are 25 years old.

You live in Addis Ababa.

Nice to meet you! Keep learning Python 🚀

⭐ Challenge:
Create a conversation program asking your favorite food.