#!/usr/bin/env python3
s1 = input('Last year score:') s2 = input('This year score:') inc = (int(s2) - int(s1))/int(s1) * 100 print("Increment = %.1f%%" % inc)
输出结果
Last year score:76 This year score:83 Increment = 9.2%
Sign in to make a reply
小O_园子
#!/usr/bin/env python3
s1 = input('Last year score:') s2 = input('This year score:') inc = (int(s2) - int(s1))/int(s1) * 100 print("Increment = %.1f%%" % inc)
输出结果