Commit 99b905cc by BellCodeEditor

auto save

parent bdfdf4fc
# for i in range(1,10):
# for j in range(1,i+1):
# print(j,"*",i,"=",(j*i),end=" ")
# print()
for j in range(1,10):
for i in range(1,j+1):
print(i,"*",j,"=",(j * i),end=" ")
print()
\ No newline at end of file
for i in range(1,10):
for j in range(1,i+1):
print(j,"x",i,"=",(j*i),end=" ")
print()
\ No newline at end of file
import turtle
p = turtle.Pen()
p.speed(1000)
s = turtle.Screen()
s.bgcolor("black")
c = ["red","green","yellow","orange"]
for i in range(1,300):
p.pencolor(c[i%4])
p.forward(i)
p.right(91)
p.hideturtle()
turtle.done()
import turtle
p = turtle.Pen()
s = turtle.Screen()
s.bgcolor("black")
c = ["red","green","blue","orange"]
p.speed(1000)
for i in range(1,300):
p.pencolor(c[i%4])
p.forward(i)
p.left(91)
p.hideturtle()
turtle.done()
for j in range(1,10): #列
for i in range(1,j+1): #行
print(i,"X",j,"=",(i*j),end=" ")
print()
\ No newline at end of file
import random
#p 代表玩家,c代表计算机
s = 0
while True:
p = input("玩家出拳:")
list = ["剪刀","石头","布"]
c = random.choice(list)
if p in list:
print("玩家出拳"+p)
print("计算机出拳"+c)
if p == c:
print("平局")
elif (p=="石头" and c =="剪刀") or (p=="剪刀" and c =="布") or (p=="布" and c =="石头"):
print("玩家赢")
s += 1
else:
print("你输了")
s -= 1
continue
if p == "q" or p == "Q":
break
else:
print("请正确输入")
if s > 0:
print("恭喜你赢了"+str(s)+"分")
else:
print("很遗憾你输了"+str(s)+"分")
print("游戏结束")
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