Commit 4d0d4e8c by BellCodeEditor

save project

parent 87516d43
Showing with 16 additions and 7 deletions
# 勇于挑战的创造师,请运行下面的代码,观察运行结果,和小伙伴们说说你的发现?
a= ['华雄']
c=['颜良','文丑', '许褚', '夏侯惇', '蒋干']
# 和你的小伙伴讲讲史上有名的三英战吕布的故事。然后完成下面挑战,并说说列表切片是什么,怎么用:
# 省略繁杂情节,刘关张三人一起冲入战场,围攻吕布:
a=['吕布']
b=['袁术','公孙瓒','关羽','张飞','刘备','曹操']
c=(b[3:5])
a.extend(c)
print(a)
\ No newline at end of file
......@@ -2,8 +2,13 @@ from random import randint#导入随机randint()函数
from time import sleep #导入sleep()函数
#导入函数
子弹 = 0
子弹a = 0
while True:
if 装子弹 = 0:
if 子弹a == 0:
a = randint(0,3)
if a == 1 or a == 2:
电脑选择 = 装子弹
print('电脑选择:装子弹')
子弹 += 1
\ No newline at end of file
子弹a += 1
if a == 3:
print('防御')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment