码迷,mamicode.com
首页 > 其他好文 > 详细

核心编程答案(第五章)

时间:2016-05-04 18:35:57      阅读:132      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!