Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_3
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
629fd378
authored
Apr 23, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
b7498cbe
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
3 deletions
diy1.py
diy2.py
diy3.py
diy4.py
diy5.py
diy1.py
0 → 100644
View file @
629fd378
strong
=
float
(
input
(
'请输入你的体重'
))
tall
=
float
(
input
(
'请输入你的身高'
))
Bmi
=
strong
/
(
tall
*
tall
)
print
(
'您的bmi{:.1f}'
.
format
(
Bmi
))
if
Bmi
<
18.5
:
print
(
'过轻'
)
if
18.5
<=
Bmi
<=
23.9
:
print
(
'正常'
)
\ No newline at end of file
diy2.py
0 → 100644
View file @
629fd378
sum
=
0
list
=
[
'A'
,
'B'
,
'C'
,
'D'
]
for
i
in
list
:
for
j
in
list
:
for
k
in
list
:
if
i
!=
j
and
j
!=
k
and
i
!=
k
:
print
(
i
+
j
+
k
)
sum
=
sum
+
1
print
(
sum
)
\ No newline at end of file
diy3.py
View file @
629fd378
...
...
@@ -3,9 +3,6 @@ student2 = {'语文': 97, '数学': 98, '英语': 90}
student3
=
{
'语文'
:
95
,
'数学'
:
100
,
'英语'
:
93
}
score
=
{
'悟空'
:
student1
,
'诺依'
:
student2
,
'小贝'
:
student3
}
# 查询并打印出输入的名字对应的所有科目的成绩
while
True
:
name
=
input
(
"名字:"
)
...
...
diy4.py
0 → 100644
View file @
629fd378
def
Num
(
n
):
count
=
0
for
i
in
range
(
1
,
n
+
1
):
if
n
%
i
==
0
:
count
=
count
+
1
if
count
==
2
:
return
1
for
i
in
range
(
1
,
1001
):
string
=
str
(
i
)
if
'3'
in
string
:
if
'33'
in
string
:
string
=
'&'
+
string
if
Num
(
i
):
string
=
string
+
'*'
print
(
string
)
\ No newline at end of file
diy5.py
0 → 100644
View file @
629fd378
import
turtle
pen
=
turtle
.
Pen
()
pen
.
hideturtle
()
for
i
in
range
(
12
):
pen
.
pencolor
(
'red'
)
pen
.
circle
(
120
,
30
)
pen
.
pencolor
(
'black'
)
pen
.
fillcolor
(
'yellow'
)
pen
.
begin_fill
()
pen
.
right
(
120
)
pen
.
forward
(
80
)
pen
.
left
(
60
)
pen
.
forward
(
80
)
pen
.
left
(
120
)
pen
.
forward
(
80
)
pen
.
left
(
60
)
pen
.
forward
(
80
)
pen
.
end_fill
()
pen
.
right
(
120
)
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