alien_color = ['green','yellow','red']
for color in alien_color:
if color == 'green':
print 'alien_color_%s: player to obtain five !'%color
elif color == 'yellow':
print 'alien_color_%s: player to obtain ten !' % color
else:
print 'alien_color_%s: player to obtain ten-five !' % color
try:
age = input('please value a integer:') #####input输入的是整数,raw_input输入的是字符串
if int(age) < 2:
print 'he is a baby!'
elif int(age) >= 2 and int(age) < 4:
print 'he is going!'
elif int(age)>= 4 and int(age) < 13:
print 'he is a teenager!'
elif int(age) >= 13 and int(age) < 65:
print 'he is a Middle-aged people!'
else:
print 'he is a old people!'
except:
print 'please value a integer!'
登录打招呼
user_name = ['admin', 'jack', 'bob', 'tom', 'mary']
for value in user_name:
value = raw_input('please value a user name:')
if value == 'admin':
print 'hello %s, would you like to see a status report?'% value
break
elif value not in user_name:
print 'error value'
break
else:
print 'hello %s, thank you for logging in again' % value
break
lists = [1,2,3,4,5,6,7,8,9]
for i in lists:
if i == 1:
print str(i) + 'st'
elif i == 2:
print str(i) + 'nd'
elif i == 3:
print str(i) + 'rd'
else:
print str(i) + 'th'

 
 

最新文章

  1. 关于replace()方法中第二个参数的转义问题
  2. mysql连接查询,封装mysql函数
  3. Flume
  4. iOS:JSON格式字符串转字典,字典转JSON格式字符串
  5. C#文件夹和文件操作
  6. 原创:cellmap 基站查询 for android
  7. R 网页数据爬虫1
  8. Git差异比对
  9. http://my.oschina.net/chinacion/blog/647641
  10. mysql 二进制安装文件 下载
  11. java基础知识回顾之javaIO类---FileWriter和FileReader
  12. Linux查看机器型号
  13. python+sqlite3
  14. OC中给我们提供的一个技术:谓词(NSPredicate).note
  15. Python学习—数据库篇之索引
  16. python基础面试常见题
  17. linux搭建PHP开发环境
  18. ajaxFileupload 多文件上传
  19. War Chess bfs+优先队列
  20. New Concept English Two 20 52

热门文章

  1. 理解Java中字符流与字节流的区别(转)
  2. 使用Mybatis时报错Invalid bound statement (not found):
  3. Java Redis Pipeline 使用示例
  4. C++(十五) — sizeof 运算符
  5. How to Fix “ShellExecute failed (2): Is this command correct?” on Notepad++
  6. 上传图片到阿里云oss
  7. 【spark】分区
  8. Spring:org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class
  9. jsp的运行内幕--Tomcat容器对自定义标签的解析过程
  10. win7 秘钥