Skip to content

Commit f84afde

Browse files
authored
Update videogamefan.py
Signed-off-by: Bubbles The Dev <[email protected]>
1 parent 0f62166 commit f84afde

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed
Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,53 @@
11
# EXAMPLES NOT FOR USE
22
# --------------------
33

4-
import os
54
import time
65

7-
# Clear the console
8-
os.system('cls' if os.name == 'nt' else 'clear')
6+
# Parameterize the sleep duration
7+
SLEEP_DURATION = 1
8+
9+
def clear_console():
10+
# Clear the console (optional, can be omitted if not necessary)
11+
import os
12+
os.system('cls' if os.name == 'nt' else 'clear')
13+
14+
clear_console()
915

1016
print("Hello coding community!")
11-
time.sleep(1)
17+
time.sleep(SLEEP_DURATION)
1218

1319
language = "Python" # String
1420
dreamjobtitle = "videogame development"
1521
print(f"{language} is my favorite language for programming. My favorite dream job that I want to get is {dreamjobtitle}.")
16-
time.sleep(1)
22+
time.sleep(SLEEP_DURATION)
1723

1824
age = 20 # Define the age variable with a sample value
1925

2026
if age < 18:
2127
print("Student")
28+
elif 18 <= age <= 25:
29+
print("Junior Developer")
2230
else:
23-
if age >= 18 and age <= 25:
24-
print("Junior Developer")
25-
else:
26-
print("Senior Developer")
27-
time.sleep(1)
28-
29-
def calculate_income(monthly_salary):
30-
mid_income = monthly_salary * 6
31-
return mid_income
31+
print("Senior Developer")
32+
time.sleep(SLEEP_DURATION)
33+
34+
def calculate_six_month_income(monthly_salary):
35+
"""
36+
Calculate income for a six-month period based on the monthly salary.
37+
38+
Args:
39+
monthly_salary (float): Monthly salary amount.
40+
41+
Returns:
42+
float: Total income for six months.
43+
"""
44+
six_month_income = monthly_salary * 6
45+
return six_month_income
3246

3347
# Example usage
3448
monthly_salary = 1000
35-
mid_income = calculate_income(monthly_salary)
36-
print(f"The mid income for 6 months is ${mid_income}")
49+
six_month_income = calculate_six_month_income(monthly_salary)
50+
print(f"The income for 6 months is ${six_month_income:.2f}")
3751

3852

3953
# STUDENT PASSED ACTIVITY

0 commit comments

Comments
 (0)