Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-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
7e55fd11
authored
Jun 03, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
9ed85b40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
9 deletions
diy.py
diy.py
View file @
7e55fd11
# 神奇百货中的物品已经帮你创建好啦,接下来要看你的了~
dict
=
{
'可口可乐'
:
3
,
'旺仔牛奶'
:
4
,
'农夫山泉'
:
1
,
'辣条'
:
3
,
'巴西烤肉'
:
2
,
'果冻'
:
4
,
'乐事'
:
5
,
'奥利奥'
:
10
,
'巧克力'
:
6
}
j
=
input
(
"你要买什么?"
)
if
j
in
dict
:
prink
(
'巧克力'
(
dict
[
j
]))
else
:
prink
()
\ No newline at end of file
# a=input('输入一个字符出啊')
# a=a[1::2]
# b=[]
# for i in a:
# b.append(i)
# print(b)
# a=input("输入一个字符拆")
# b=len(a)
# c=[]
# for i in range(b):
# if i%2==0:
# c.append(a[i])
# print(c)
b
=
'qweqwrqrwf我的'
a
=
'''某航空公司对于托运行李有尺寸要求,必须满足以下条件:
每件托运行李的长、宽、高三边之和须大于或等于60厘米,且
小于或等于203厘米。(注意只是三边,不考虑立方体的整个
周长,相当于只求长+宽+高三个数字的和,如,长宽高为:20
、30、40,则之和为90)
编写一个重复执行的程序,要求如下:
1、用户一次性输入三个数字,分别代表行李的长、宽、高(单位:厘米),
三个数字直接用英文的逗号隔开;如:23,45,67
2、程序自动将输入的。长!宽高。转化为列表或者元组;
3、程序需要判断用户输入的托运行李尺寸是否满足此航空公司的要求。
4、如果满足要求,就输出"可以托运"。如果不满足要求,就输出"不可以托运"。
5、然后重复以......上操作,重复次数不限。'''
a
=
int
(
input
(
"输入边数"
))
len
=
15
import
turtle
b
=
turtle
.
Pen
()
ys
=
[
'red'
,
'blue'
,
'orange'
,
'green'
]
b
.
shape
(
'turtle'
)
for
i
in
range
(
a
):
b
.
forward
(
len
)
b
.
left
(
360
/
a
)
b
.
color
(
ys
[
i
%
4
])
len
+=
5
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