Basic Arithmetic Operators
02 / شرح الدرس مكتوبًاmain.py
نص شرح المعلم والكود الذي كتبه ونتيجة تشغيله، بنفس ترتيب الدرس.
# ==========================================
# Python for Beginners
# Lecture 8: Basic Arithmetic Operators
# ==========================================
# Lecture Contents:
# 1. What Are Arithmetic Operators?
# 2. Addition (+)
# 3. Subtraction (-)
# 4. Multiplication (*)
# 5. Division (/)
# 6. Practical Examples
# 7. Practice Task
# ==========================================
number1 = 5
number2 = 10
# print(number1+number2)
# 2. Addition (+)
number1 = 5
number2 = 10
# print(number1+number2)
# 3. Subtraction (-)
number1 = 50
num2 = 10
# print(number1-num2)# 50 - 10 = 40
# 4. Multiplication (*)
number1 = 50
num2 = 10
print(num2*number1) # 10 * 50 = 500
# 5. Division (/)
num1 = 60
num3 = 12
print(num1/num3) # 60 /12 = 5
#Store
product1 =100
product2 =105
product3 =400
budget = 1000
total_price = product1+product2+product3
remaing_money = budget-total_price
print("Total Price:",total_price) # 100 + 105 +400 = 605
print("Remaning Money:",remaing_money) #1000 - 605 = 395