第1关:学费计算

1
2
3
4
5
6
7
8
9
10
11
12
13
python = 3
math = 4
english = 4
physical = 2
military_theory = 2
philosophy = 2

credits = python + math + english + physical + military_theory + philosophy
tuition_fee_per_credit = int(input())
tuition_fee = credits * tuition_fee_per_credit

print(f"你本学期选修了{credits}个学分。")
print(f"你应缴纳的学费为{tuition_fee}元。")

第2关:助学贷款

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
python = 3
math = 4
english = 4
physical_education = 2
military_theory = 2
philosophy = 2

# 补充你的代码
tuition_per_credit = float(input("请输入每学分学费金额:"))
living_expenses = float(input("请输入你每个月生活费:"))

total_credits = python + math + english + physical_education + military_theory + philosophy
total_tuition = total_credits * tuition_per_credit
total_cost = living_expenses * 5 + total_tuition
student_loan = total_cost * 0.6

print(f"本学期你能够贷款{student_loan:.2f}元")