首页 > 其他 > 详细

核心编程答案(第五章)

时间:2016-05-04 18:35:11      阅读:319      评论:0      收藏:0      [点我收藏+]

5-3

def LevelTest(score):
    if 90 <= score <= 100:
        return ‘A‘
    elif 80 <= score < 90:
        return ‘B‘
    elif 70 <= score < 80:
        return ‘C‘
    elif 60 <= score < 70:
        return ‘D‘
    elif score < 60:
        return ‘F‘
    else:
        return ‘NO FOUND‘

score = raw_input(‘Please enter you score: ‘)
score = int(score)
print LevelTest(score)

 5-4

def Runnian(year):
    if (year % 4 == 0) and (year % 100 != 0) or year % 400 == 0:
        return ‘Is runnian!‘
    else:
        return ‘Is not runnin‘

year = int(raw_input(‘Please enter the year: ‘))
print Runnian(year)

 

核心编程答案(第五章)

原文:http://www.cnblogs.com/ohmydenzi/p/5459245.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!