wap网站 区别,沈阳seo公司,做网站分辨率多少,新吴网站建设近日在学习Python的一些基础知识#xff0c;觉得还是很有趣的一个一门语言#xff01;就目前的学习的一些知识#xff0c;编写了一些一个简单的石头剪刀布的游戏。主要是熟悉一些Python的一些控制语句。
import random
while 1:sint(random.randint(1,3))print(s)print()if…近日在学习Python的一些基础知识觉得还是很有趣的一个一门语言就目前的学习的一些知识编写了一些一个简单的石头剪刀布的游戏。主要是熟悉一些Python的一些控制语句。
import random
while 1:sint(random.randint(1,3))print(s)print()if s1:indstoneelif s2:indscissorselif s3:indpaperminput(Please input your option,if you input the end, this game will be end. )blist[stone,scissors,paper]if (m not in blist) and (m!end):print(your input is wrong and please input the right option again or end the game: )elif (m not in blist) and (mend):print(the game is ending now...)breakelif mind:print(draw)elif (mstone and indscissors) or (mpaper and indstone) or (mscissors and indpaper):print(you win this game)elif (mstone and indpaper) or (mpaper and indscissors) or (mscissors and indstone):print( you loss this game)
下面是结果
看着应该还可以比较简单我会继续学些