Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson6-5-1
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
a58be0b3
authored
Sep 28, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
8d77c0f6
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
98 additions
and
0 deletions
1.py
2.py
2/1.py
2/2.py
2/3.py
2/4.py
3.py
4.py
5.py
6.py
7.py
1.py
0 → 100644
View file @
a58be0b3
import
turtle
pen
=
turtle
.
Pen
()
pen
.
fillcolor
(
"blue"
)
pen
.
begin_fill
()
for
i
in
range
(
5
):
pen
.
fd
(
100
)
pen
.
rt
(
360
/
5
)
pen
.
end_fill
()
pen
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
2.py
0 → 100644
View file @
a58be0b3
import
random
jp
=
[
"小贝玩偶"
,
"iPad"
,
"小机器人"
,
"悟空玩偶"
]
donejp
=
random
.
choice
(
jp
)
name
=
input
(
"你的名字叫什么?"
)
print
(
"恭喜你,幸运的创造师——"
+
name
+
",获得了"
+
donejp
)
\ No newline at end of file
2/1.py
0 → 100644
View file @
a58be0b3
students
=
{
'John'
:
10
,
'Sam'
:
11
,
'Lily'
:
9
,
'Anna'
:
10
}
#print(students['Sam'])
if
'Lily'
in
students
:
students
[
'Lily'
]
=
10
#print(students['Lily'])
students
[
'Sally'
]
=
11
#print(students['Sally'])
print
(
students
)
\ No newline at end of file
2/2.py
0 → 100644
View file @
a58be0b3
menu
=
{
'红烧鱼'
:
36
,
'手撕鸡'
:
48
,
'烤鸭'
:
56
,
'盐焗鸡'
:
78
,
'时蔬'
:
18
,
'米饭'
:
3
}
for
a
,
b
in
menu
.
items
():
print
(
a
,
b
)
#menu.pop('烤鸭')
#print(menu)
#menu.clear()
#print(menu)
\ No newline at end of file
2/3.py
0 → 100644
View file @
a58be0b3
wkp
=
{
'数学'
:
88
,
'英语'
:
90
,
'语文'
:
85
}
nyp
=
{
'数学'
:
93
,
'英语'
:
90
,
'语文'
:
89
}
xbp
=
{
'数学'
:
94
,
'英语'
:
92
,
'语文'
:
84
}
k
=
{
'wk'
:
wkp
,
'ny'
:
nyp
,
'xb'
:
xbp
}
for
a
,
b
in
wkp
.
items
():
print
(
a
,
b
)
print
(
nyp
[
'语文'
])
xbp
[
'语文'
]
=
86
for
c
,
d
in
k
.
items
():
print
(
c
,
d
)
\ No newline at end of file
2/4.py
0 → 100644
View file @
a58be0b3
while
True
:
a
=
input
(
"请输入一个数"
)
b
=
input
(
"请输入一个数"
)
c
=
input
(
"请输入一个数"
)
try
:
a
=
int
(
a
)
b
=
int
(
b
)
c
=
int
(
c
)
except
:
print
(
"请输入整数"
)
else
:
d
=
a
+
b
+
c
print
(
d
)
\ No newline at end of file
3.py
0 → 100644
View file @
a58be0b3
import
turtle
pen
=
turtle
.
Pen
()
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"blue"
)
talk
=
screen
.
textinput
(
"提示"
,
"请输入祝福语:"
)
pen
.
write
(
talk
,
font
=
(
"Microsoft_Black"
,
28
,
"normal"
))
pen
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
4.py
0 → 100644
View file @
a58be0b3
i
=
0
while
True
:
i
+=
1
if
i
%
3
==
0
:
continue
else
:
print
(
i
)
if
i
==
100
:
break
\ No newline at end of file
5.py
0 → 100644
View file @
a58be0b3
for
i
in
range
(
2
,
18
,
3
):
print
(
i
,
end
=
" "
)
\ No newline at end of file
6.py
0 → 100644
View file @
a58be0b3
name
=
[
'John'
,
'Sam'
,
'Lily'
,
'Anna'
,
'Helen'
]
name
[
2
]
=
"Nina"
name
.
insert
(
3
,
"Sally"
)
name1
=
[
'Daming'
,
'Neo'
,
'Sally'
]
name
.
extend
(
name1
)
name
.
pop
(
1
)
print
(
name
[
4
:
7
])
print
(
name
)
\ No newline at end of file
7.py
0 → 100644
View file @
a58be0b3
'''
text=['p','y','t','h','o','n']
text1="".join(text)
print(text1)
'''
text1
=
'贝尔星球'
print
(
list
(
text1
))
\ 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