Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson10-2
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
b135a693
authored
Jul 21, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
5958090a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
11 deletions
diy1.py
diy1.py
View file @
b135a693
...
@@ -4,12 +4,12 @@
...
@@ -4,12 +4,12 @@
# break# 结尾缩进
# break# 结尾缩进
#print('第6个孩子宙斯逃过一劫')# 输出缩进
#print('第6个孩子宙斯逃过一劫')# 输出缩进
#2,
city = ['纽约','华盛顿','桃源岛','洛杉矶','芝加哥','旧金山']
city
=
[
'纽约'
,
'华盛顿'
,
'桃源岛'
,
'洛杉矶'
,
'芝加哥'
,
'旧金山'
]
#
e=input('你想去哪里啊?')
e
=
input
(
'你想去哪里啊?'
)
#
if e in city:
if
e
in
city
:
#
print('可以乘坐飞机通往'+e)
print
(
'可以乘坐飞机通往'
+
e
)
#
else:
else
:
#
print('没有'+e+'这座城市')
print
(
'没有'
+
e
+
'这座城市'
)
#3,纠错
#3,纠错
...
@@ -34,9 +34,22 @@
...
@@ -34,9 +34,22 @@
#fun1()
#fun1()
#fun2()
#fun2()
list
=
[
'盘丝洞'
,
'白骨洞'
,
'大雁塔'
]
monster
=
{
'盘丝洞'
:
'蜘蛛精'
,
'白骨洞'
:
'白骨精'
,
'大雁塔'
:
'花妖'
}
print
(
list
[
2
])
list
[
'地府'
]
=
'僵尸'
print
(
monster
)
#list=['盘丝洞','白骨洞','大雁塔']
#monster={'盘丝洞':'蜘蛛精','白骨洞':'白骨精','大雁塔':'花妖'}
#print(list[3]) #索引是从0开始的 所以上面的索引最多到2
#monster.append('地府','僵尸')#
#print(monster)
#list=['盘丝洞','白骨洞','大雁塔']
#monster={'盘丝洞':'蜘蛛精','白骨洞':'白骨精','大雁塔':'花妖'}
#print(list[2])
#monster['地府']='僵尸'
#print(monster)
#报菜名 纠错
#total={'香港':{'日式法餐':'Ta Vie','古法粤菜':'家全七福','法式酒馆':'Belon'},'曼谷':{'泰国料理':'Paste','印度北欧料理':'Gaa','德国菜':'Suhring'},'东京':{'中华料理':'茶禅华','寿司':'Sushi Saito','怀石料理':'龙吟'}}
#for k,v in total.items():
# for m,n in v.items():
# if m =='怀石料理':
# print(v[m])
\ 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