Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-1-1_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
d4ab0f1d
authored
Jun 20, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
95d42e94
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
1.py
diy1.py
1.py
0 → 100644
View file @
d4ab0f1d
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
diy1.py
View file @
d4ab0f1d
# 利用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
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