Discuss / Python / 1

露心

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

s1 = 72

s2 = 85

r = (s2-s1) / s1

print('%.2f' % r)

print('小明成绩从去年的{}分,到现在{}分,提升了{:.2f}%'.format(s1, s2, r))

print('小明成绩从去年的%d分,到现在%d分,提升了%.2f%%'%(s1, s2, r))

print(f'小明成绩从去年的{s1}分,到现在{s2}分,提升了{r:.2f}%')


  • 1

Reply