Discuss / Python / 交作业 交作业

交作业 交作业

Topic source

初暮雪阳

#1 Created at ... [Delete] [Delete and Lock User]

print("练习题")
print("练习小明的成绩从去年的72分提升到了今年的85分,\
请计算小明成绩提升的百分点,并用字符串格式化显示出'xx.x%',只保留小数点后1位:")
new = input("今年成绩;")
new=float(new)
old= input("去年成绩:")
old=float(old)
print("今年比去年提升了:%s" % (float('%0.1f'% ((new-old)/old*100) )) ,"%")

  • 1

Reply