Enter the scores of 3 courses of Python, Java and C # from the console, write the program to achieve: (1) the difference between the scores of Python and Java courses (2) the average score of 3 courses

p=float(input("请输入Python成绩:"))
j=float(input("请输入JAVA成绩:"))
c=float(input("请输入C#成绩:"))
a=abs(p-j)
b=(p+j+c)/3
print("Python和JAVA的分数之差为:%.2f\n三门课程的平均分数为:%.2f"%(a,b))
Published 5 original articles · Likes0 · Visits 6

Guess you like

Origin blog.csdn.net/weixin_46520272/article/details/105445067