设为首页收藏本站

Crossin的编程教室

 找回密码
 立即加入
查看: 27286|回复: 0
打印 上一主题 下一主题

【Python 第26课】 操作list

[复制链接]

0

主题

0

好友

54

积分

注册会员

Rank: 2

楼主
发表于 2015-5-27 21:33:02 |显示全部楼层
  1. from random import choice
  2. print "Choice one direction to shoot:"
  3. print "left,ceter,right"
  4. you=raw_input()
  5. print "You kicked "+ you
  6. direction=['left','center','right']
  7. com=choice(direction)
  8. print "Computer saved "+ com
  9. if you !=com:
  10.     print "Goal!"
  11. else:
  12.     print "Oops..."
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

QQ|手机版|Archiver|Crossin的编程教室 ( 苏ICP备15063769号  

GMT+8, 2024-5-6 08:45 , Processed in 0.028569 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部