Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-2_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
6c97a0f9
authored
Dec 17, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
72da1a93
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
17 deletions
1.py
2.py
3.py
4.py
5.py
star.py
1.py
0 → 100644
View file @
6c97a0f9
a
=
input
(
"钱数"
)
b
=
input
(
"数量"
)
c
=
input
(
"单价"
)
if
int
(
a
)
>=
int
(
b
)
*
int
(
c
):
print
(
"True"
)
else
:
print
(
"False"
)
\ No newline at end of file
2.py
0 → 100644
View file @
6c97a0f9
3.py
0 → 100644
View file @
6c97a0f9
import
turtle
turtle
.
setheading
(
110
)
turtle
.
pensize
(
5
)
turtle
.
color
(
"red"
,
"yellow"
)
turtle
.
begin_fill
()
for
i
in
range
(
5
):
turtle
.
forward
(
150
)
turtle
.
left
(
144
)
turtle
.
end_fill
()
turtle
.
done
()
\ No newline at end of file
4.py
0 → 100644
View file @
6c97a0f9
a
=
input
(
"请输入你的鞋码"
)
b
=
(
int
(
a
)
+
10
)
/
2
print
(
"你的脚长是"
+
str
(
b
)
+
"厘米"
)
\ No newline at end of file
5.py
0 → 100644
View file @
6c97a0f9
star.py
View file @
6c97a0f9
import
random
import
turtle
while
True
:
turtle
.
pensize
(
10
)
player
=
input
(
"你要出(石头/剪刀/布):"
)
turtle
.
backward
(
90
)
print
(
"玩家出:"
+
player
)
for
i
in
range
(
3
):
a
=
[
"石头"
,
"剪刀"
,
"布"
]
turtle
.
forward
(
180
)
computer
=
random
.
choice
(
a
)
turtle
.
left
(
120
)
print
(
"电脑出:"
+
computer
)
turtle
.
forward
(
90
)
if
player
in
a
:
turtle
.
left
(
90
)
if
player
==
comtuter
:
turtle
.
forward
(
150
)
print
(
"平局"
)
turtle
.
penup
()
elif
((
player
==
"石头"
and
computer
==
"剪刀"
)
or
(
player
==
"剪刀"
and
computer
==
"布"
)
or
(
player
==
"布"
and
computer
==
"石头"
)):
turtle
.
goto
(
0
,
0
)
print
(
"你赢了"
)
turtle
.
pendown
()
else
:
turtle
.
right
(
90
)
print
(
"你输了"
)
turtle
.
color
(
"black"
,
"blue"
)
else
:
turtle
.
begin_fill
()
print
(
"----请重新输入----"
)
turtle
.
circle
(
50
)
\ No newline at end of file
turtle
.
end_fill
()
turtle
.
left
(
90
)
turtle
.
forward
(
150
)
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