GPA计算方法来源于百度文库的方法,《重庆大学学分绩点计算办法(试行)》
运行环境:python 3.x
脚本源码:
# 用于重庆大学GPA计算 # author: DYBOY input_continue = 'y' jidian_result = 0.0 input_score_quanzhong = 0.0 all_score = 0.0 counter = 0 while(input_continue == 'y'): input_score = input("请输入科目成绩:") if(int(input_score)): input_score_quanzhong = int(input('请输入该类科目学分:')) all_score= all_score + input_score_quanzhong if(int(input_score) < 90): #小于90分的绩点计算 jidian_result = jidian_result + input_score_quanzhong*(int(input_score)-50)/10 elif(int(input_score) >= 90): #成绩大于90分 jidian_result = jidian_result + input_score_quanzhong*4.0 input_continue = input("是否继续请输入(y/n):") print('最终绩点:'+ str((jidian_result)/all_score))
版权声明:《 重庆大学GPA计算python程序 》为DYBOY原创文章,转载请注明出处!
最后编辑:2018-9-5 23:09:33