Commit d4ab0f1d by BellCodeEditor

auto save

parent 95d42e94
Showing with 65 additions and 2 deletions
import random,time
punches = ['石头','剪刀','布']
computer_choice = random.choice(punches)
while True:
user_choice=''
user_choice=input('请出拳:(剪刀,石头,布)')
while user_choice not in punches:
print('输入错误,请重新出拳:')
user_choice=input()
print('----战斗过程----')
print(computer_choice)
print(user_choice)
time.sleep(1)
if (computer_choice=='石头' and user_choice=='布') or (computer_choice=='布' and user_choice=='剪刀') or (computer_choice=='剪刀' and user_choice=='石头'):
print('yeah,你赢了!')
break
elif computer_choice==user_choice:
continue
else:
print('Oh,你输了')
break
\ No newline at end of file
# 利用write()帮助悟空给诺依回信吧~ # 利用write()帮助悟空给诺依回信吧~
import turtle import turtle
pen=turtle.Pen pen=turtle.Pen
pen.write("你好诺一很高兴收到你的来信",font=("Times",20,"normal")) # pen.write("你好诺一很高兴收到你的来信",font=("Times",20,"normal"))
pen.hideturtle() # pen.hideturtle()
pen.circle(50)
turtle.done() turtle.done()
\ 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