-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasicOP-real-world-task.py
More file actions
52 lines (37 loc) · 2.01 KB
/
basicOP-real-world-task.py
File metadata and controls
52 lines (37 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
## 🔢 **4. Basic Operations and Real-World Tasks (10 mins)**
### ✅ **Math Operations:**
salary = 55000 # Annual Salary 💰
bonus = 5000 # Performance Bonus 💸
total_income = salary + bonus # Total Income 💵
print("Total Income:", total_income) # Output: Total Income: 60000
#--------------------------------------------
### ✅ **Real-World Example: Automating Salary Calculation**
hours_worked = 160 # Hours Worked 🕒
hourly_rate = 25 # Hourly Rate 💲
monthly_income = hours_worked * hourly_rate # Monthly Income 💵
print("Monthly Income:", monthly_income) # Output: Monthly Income: 4000
#--------------------------------------------
### 🛠️ **Student Activity:**
# - Write a program to calculate your **monthly savings** after deducting rent and utilities.
#------------------------------------------------
# Print Basic Operations and Real-World Tasks
print("## 🔢 **4. Basic Operations and Real-World Tasks (10 mins)**\n")
# Print Math Operations Section
print("### ✅ **Math Operations:**\n")
print("# salary = 55000 # Annual Salary 💰")
print("# bonus = 5000 # Performance Bonus 💸")
print("# total_income = salary + bonus # Total Income 💵")
print('# print("Total Income:", total_income) # Output: Total Income: 60000\n')
# Print Separator
print("#--------------------------------------------\n")
# Print Real-World Example Section
print("### ✅ **Real-World Example: Automating Salary Calculation**\n")
print("# hours_worked = 160 # Hours Worked 🕒")
print("# hourly_rate = 25 # Hourly Rate 💲")
print("# monthly_income = hours_worked * hourly_rate # Monthly Income 💵")
print('# print("Monthly Income:", monthly_income) # Output: Monthly Income: 4000\n')
# Print Separator
print("#--------------------------------------------\n")
# Print Student Activity Section
print("### 🛠️ **Student Activity:**\n")
print("# - Write a program to calculate your **monthly savings** after deducting rent and utilities.\n")