Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-5_DIY1
This project
Loading...
Sign in
Toggle navigation
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
a52f54dd
authored
Jul 01, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
e0cbc797
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
4 deletions
1.py
2.py
3.py
1.py
View file @
a52f54dd
我的娃达娃的
wdawdawdaw
伟大伟大伟大伟大
\ No newline at end of file
import
random
player
=
input
(
"请出拳:石头/剪刀/布"
)
# 玩家出拳
print
(
"玩家出拳:"
+
player
)
a
=
[
"石头"
,
"剪刀"
,
"布"
]
b
=
random
.
choice
(
a
)
print
(
"电脑出拳:"
+
b
)
if
player
in
a
:
if
player
==
b
:
print
(
"平局"
)
elif
player
==
"石头"
and
b
==
"剪刀"
:
print
(
"恭喜,你赢了"
)
elif
player
==
"剪刀"
and
b
==
"布"
:
print
(
"恭喜,你赢了"
)
elif
player
==
"布"
and
b
==
"石头"
:
print
(
"恭喜你,你赢了"
)
else
:
print
(
"很遗憾,你输了"
)
else
:
print
(
"输入错误,请重新输入"
)
\ No newline at end of file
2.py
0 → 100644
View file @
a52f54dd
a
=
12
print
(
type
(
a
))
# type(a)
# for i in range(100):
# if i%2==0:
# continue
# print(i)
# a=1
# for i in range(4):
# if i==3:
# break
# a=a+1
# else:
# a=a+2
# print(a)
# import random
# list=['1','2','3','4','5','6','7','8','9','0']
# lis = ""
# for i in range(6):
# lit = random.choice(list)
# list.remove(lit)
# lis = lis+lit
# print(lis)
# while True:
# a=input("请输入内容:")
# if len(a)%2==0:
# print(a[-1])
# else:
# print(a[len(a)//2])
# import random
# b = []
# for i in range(100):
# a = random.randint(0,10)
# b.append(a)
# print(b)
# 11 16 26
# 12 15 18 21 24 27
\ No newline at end of file
3.py
0 → 100644
View file @
a52f54dd
# while True:
# a = input("请输入内容:")
# if len(a)%2 == 1:
# print(a[len(a)//2])
# else:
# print(a)
import
turtle
turtle
.
color
(
'black'
)
turtle
.
pensize
(
10
)
turtle
.
pendown
()
turtle
.
forward
(
90
)
turtle
.
left
(
120
)
turtle
.
forward
(
180
)
turtle
.
left
(
120
)
turtle
.
forward
(
180
)
turtle
.
left
(
120
)
turtle
.
forward
(
90
)
# turtle.left(90)
# turtle.forward(150)
# turtle.backward(150)
# turtle.right(90)
turtle
.
fillcolor
(
'blue'
)
turtle
.
begin_fill
()
turtle
.
circle
(
50
)
turtle
.
end_fill
()
turtle
.
left
(
90
)
turtle
.
forward
(
150
)
turtle
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment