Commit 78aaf602 by BellCodeEditor

save project

parent b0871040
Showing with 18 additions and 21 deletions
import random
Ansser=["stong","sizzer","paper"]
#player
player_ansser=input("player's:(stong/sizzer/paper)")
#computer
computer_ansser=random.choice(Ansser)
print("computer's:"+computer_ansser)
#compare
if computer_ansser=="stong" and player_ansser=="paper":
print("You win!")
elif computer_ansser=="sizzer" and player_ansser=="stong":
print("You win!")
elif computer_ansser=="paper" and player_ansser=="sizzer":
print("You win!")
elif computer_ansser==player_ansser:
print("We're all win!")
else:
print("You lose.")
\ No newline at end of file
def new_input():
total=[]
while True:
unit=input("jiage:")
if unit=='q':
break
else:
try:
unit=int(unit)
except:
print("要输入int")
else:
total.append(unit)
print('结束')
print(total)
new_input()
\ 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