分享

PYTHON 之 if elif else 使用

 心不留意外尘 2016-08-02

http://www.oschina.net/code/snippet_2245269_43676

2014

 #!/usr/bin/env python
  2 while True:
  3
  4     score=int(raw_input('please input your score(0-100): '))
  5     if score >=90 and score <=100:
  6         print 'your are A type'
  7     elif 80<=score<=89:
  8         print 'you are B type'
  9     elif 70<=score<=79:
 10         print 'you are C type'
 11     elif 60<=score<=69:
 12         print 'you are D type'
 13     elif 0<=score<60:
 14         print 'you are F type'
 15     else:
 16         print 'you are input a wrong score.'

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约