Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_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
d200cfb2
authored
Jul 02, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
b8d37555
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
6 deletions
...............................................................................................py
.....................py
diy.py
diy3.py
u.py
...............................................................................................py
0 → 100644
View file @
d200cfb2
import
pdb
;
pdb
.
set_trace
()
\ No newline at end of file
.....................py
0 → 100644
View file @
d200cfb2
dict
=
{
"可口可乐"
:
3
,
"旺仔牛奶"
:
4
,
"农夫山泉"
:
1
,
"辣条"
:
3
,
"巴西烤肉"
:
2
,
"果冻"
:
4
,
"乐事"
:
5
,
"奥利奥"
:
10
,
"巧克力"
:
6
}
s
=
input
(
"你想买什么?"
)
if
s
in
dict
:
print
(
"您的商品"
+
s
+
"需要"
+
str
(
dict
[
s
])
+
"元"
)
else
:
print
(
"对不起,本售货机里没有您想要的商品☹️ ☹️"
)
\ No newline at end of file
diy.py
0 → 100644
View file @
d200cfb2
goods
=
{
"农夫山泉"
:
1
}
goods
.
pop
(
"农夫山泉"
)
print
(
goods
)
\ No newline at end of file
diy3.py
View file @
d200cfb2
message
=
"诺依,周末一起去看动漫展吧!"
print
(
"😀 🤣 😅 😊 😍 😗 😚 🤗 🫡 😑 😶 🌫 ️ 😣 🤐 😫 😌 😝 😓 🫤 🤑 🙁 😟 😭 😨 😁 😃 😆 😋 😘 😙 ☺ ️ 🤩 🙄 😥 😯 🤤 😞 ☹ ️ 🫠 😕 😒 😜 😴 😪 😮 😏 😂 🤦 ♀ ️❤️ 🤷 ♂ ️😉 😉 😎 😊 😒 🤡 "
)
for
i
in
range
(
len
(
message
)):
\ No newline at end of file
print
(
message
[
i
])
i
+=
1
# 请使用索引的知识,取出message所有元素(不用遍历的方式)
\ No newline at end of file
u.py
0 → 100644
View file @
d200cfb2
import
requests
r
=
requests
.
get
(
'https://www.python.org'
)
print
(
r
.
status_code
)
\ 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