Python学习8:助学贷款额度计算(python123)

类型:数值运算‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬


描述‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬

大学第一学期必选课程及其学分如下:‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬

Python 高等数学 大学英语 大学体育 军事理论 哲学
3学分 4学分 4学分 2学分 2学分 2学分
           

大学可以申请助学贷款,申请额度不超过学费和生活费总额的60%,分两行依次输入每学分应缴纳的学费(整数,单位为元)和你每个月的生活费(浮点数,单位为元),请计算你每个学期能够贷款多少元?(结果保留小数点后2位数字,每个学期按5个月计算。)输出格式请参考输入输出示例。‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬

示例‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬

输入:   
328
1600
输出:
本学期你能够贷款8145.60元

代码:

python = 3
math = 4
english = 4
physical = 2
military_theory = 2
philosophy = 2
#=======================================================
# 补充你的代码
a=int(input())
b=float(input())
n=a*(python+math+english+physical+military_theory+philosophy)
c=0.6*(b*5+n)
print("本学期你能够贷款{:.2f}元".format(c))

Python学习8:助学贷款额度计算(python123)_第1张图片

Python学习8:助学贷款额度计算(python123)_第2张图片

 

python = 3
math = 4
english = 4
physical_education = 2
military_theory = 2
philosophy = 2
tuition_per_credit = int(input())
total_credits = (python + math + english + physical_education + military_theory + philosophy)
total_tuition = total_credits * tuition_per_credit
living_expenses = float(input())
total_cost = living_expenses * 5 + total_tuition
student_loan = total_cost * 0.6
print(f'本学期你能够贷款{student_loan:.2f}元')

Python学习8:助学贷款额度计算(python123)_第3张图片

9d6bcb44ba2c4738af8ef92825f3aeb3.png

 

你可能感兴趣的:(Python123学习,学习)