Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_4
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
9d609ff3
authored
Jan 16, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
b1b21459
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
45 deletions
1.py
2.py
cmn.py
diy3.py
dvojfdi.py
1.py
View file @
9d609ff3
import
turtle
as
t
for
i
in
range
(
1
,
10
):
t
.
speed
(
30
)
for
j
in
range
(
1
,
i
+
1
):
t
.
pencolor
()
print
(
j
,
"*"
,
i
,
"="
,(
j
*
i
),
end
=
" "
)
t
.
pensize
()
print
()
a
=
1
for
i
in
range
(
300
):
t
.
forward
(
a
)
a
+=
1
t
.
right
(
91
)
t
.
ht
()
t
.
done
()
...
...
2.py
0 → 100644
View file @
9d609ff3
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
j
,
"*"
,
i
,
"="
,(
j
*
i
),
end
=
" "
)
print
()
cmn.py
View file @
9d609ff3
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
j
,
"*"
,
i
,
"="
,(
j
*
i
),
end
=
" "
)
print
()
diy3.py
View file @
9d609ff3
student1
=
{
'语文'
:
91
,
'数学'
:
88
,
'英语'
:
85
}
import
turtle
as
t
student2
=
{
'语文'
:
97
,
'数学'
:
98
,
'英语'
:
90
}
t
.
pencolor
(
"red"
)
student3
=
{
'语文'
:
95
,
'数学'
:
100
,
'英语'
:
93
}
t
.
pensize
(
1
)
score
=
{
'悟空'
:
student1
,
'诺依'
:
student2
,
'小贝'
:
student3
}
t
.
speed
(
1
)
t
.
bgcolor
(
"blue"
)
word
=
"欢迎来到寓乐湾
\n
welcome to"
wold
=
t
.
write
(
word
,
font
=
(
"Arial,50,bold"
))
# 查询并打印出输入的名字对应的所有科目的成绩
while
True
:
turtle
.
done
()
name
=
input
(
"名字:"
)
\ No newline at end of file
if
name
in
score
:
a
=
score
[
name
]
print
(
'*'
*
30
)
for
k
,
v
in
a
.
items
():
print
(
k
,
v
)
break
else
:
print
(
'输入错误'
)
\ No newline at end of file
dvojfdi.py
View file @
9d609ff3
student1
=
{
'语文'
:
91
,
'数学'
:
88
,
'英语'
:
85
}
import
turtle
as
t
student2
=
{
'语文'
:
97
,
'数学'
:
98
,
'英语'
:
90
}
t
.
pencolor
(
"blue"
)
student3
=
{
'语文'
:
95
,
'数学'
:
100
,
'英语'
:
93
}
t
.
pensize
(
6
)
score
=
{
'悟空'
:
student1
,
'诺依'
:
student2
,
'小贝'
:
student3
}
t
.
speed
(
4
)
while
True
:
t
.
bgcolor
(
"red"
)
print
(
'请输入要查询的名字,退出请输入q'
)
word
=
"欢迎来到寓乐湾
\n
welcome to"
name
=
input
(
"名字:"
)
t
.
write
(
word
,
font
=
(
"Arial,50,bold"
))
if
name
in
score
:
a
=
score
[
name
]
print
(
'*'
*
30
)
for
k
,
v
in
a
.
items
():
turtle
.
done
()
print
(
k
,
v
)
print
(
'*'
*
30
)
elif
name
==
'q'
:
break
else
:
print
(
'输入错误'
)
\ 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