Commit 517c182d by BellCodeEditor

auto save

parent 35e54b35
Showing with 30 additions and 2 deletions
if elif else
if else
\ No newline at end of file
#玩家出拳
p = input("请输入玩家出的内容")
print("Player:"+p)
#计算机出拳
#1.导入random模块
import random
#2.创建一个列表
list = ["石头","剪刀","布"]
c = random.choice(list)
print("computer:"+c)
#判断输赢
if p in list:
if c == p :
print("平局")
elif (p =="石头" and c == "剪刀") or (p =="剪刀" and c == "布") or (p =="布" and c == "石头"):
print("玩家胜利")
else:
print("计算机胜利")
else:
print("输入有误")
\ No newline at end of file
# 上节课你是这样绘制的五角星👇:
# 这节课你可以利用新学的知识自定义五角星的颜色么?
import turtle
color = input("请输入颜色")
pen = turtle.Pen()
pen.fillcolor("red") #内部填充红色
pen.fillcolor(color) #内部填充红色
#绘制五角星#
pen.begin_fill()
for i in range(5): #重复执行5次
......
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