Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson2-5_DIY1

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit c3c97ba5 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent fdf1a1c2
Hide whitespace changes
Inline Side-by-side
Showing with 9 additions and 6 deletions
  • diy1.py
diy1.py
View file @ c3c97ba5
...@@ -4,9 +4,12 @@ print("玩家出拳:"+x) ...@@ -4,9 +4,12 @@ print("玩家出拳:"+x)
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
y=random.choice(list) y=random.choice(list)
print("机器人出拳:"+y) print("机器人出拳:"+y)
if x==y: if x in list:
print("平局") if x==y:
elif (x=="石头" and y=="剪刀") or (x=="剪刀" and y=="布") or (x=="布" and y=="石头"): print("平局")
print("玩家胜") elif (x=="石头" and y=="剪刀") or (x=="剪刀" and y=="布") or (x=="布" and y=="石头"):
print("玩家胜")
else :
rint("机器人胜")
else : else :
rint("机器人胜") print("请重新输入")
\ No newline at end of file \ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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