Discuss / Python / 作业

作业

Topic source

most_逐

#1 Created at ... [Delete] [Delete and Lock User]
# -*- coding: utf -8 -*-
print('''作业:
小明的成绩从去年的72分提升到了今年的85分,
请计算小明成绩提升的百分点,并用字符串格式化显示出'xx.x%',
只保留小数点后1位:

''')
new=input('今年的成绩:')
old=input('去年的成绩:')
A = eval(new)-eval(old)
print('小明今年的成绩比去年提高了:%.1f%%' %((A/72)*100))

  • 1

Reply