Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson5_5
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
d6ede28d
authored
Oct 07, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0e362b76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
4 deletions
diy2.py
diy2.py
View file @
d6ede28d
i
=
1
# 行
for
j
in
range
(
1
,
10
):
print
(
i
,
'x'
,
j
,
'='
,(
i
*
j
))
\ No newline at end of file
#这是单行注释
'''
这是多行注释
'''
# #输入爸爸的身高
# f = float(input("请输入爸爸的身高:"))
# #输入妈妈的身高
# m = float(input("请输入妈妈的身高:"))
# #输入性别系数
# s = float(input("请输入性别系数 1:男孩、-1:女孩:"))
# #计算孩子的身高
# z = (m+f+(13*s))/2
# #输出孩子的身高
# print("孩子的身高为:",z)
# #求长方形的面积
# #a代表长方形的长
# a = int(input("请输入长方形的长:"))
# #b代表长方形的宽
# b = int(input("请输入长方形的宽:"))
# #c代表面积
# c = a*b
# print("长方形的面积为:",c)
# #买本子
# #输入钱
# a = int(input("请输入你身上的钱有多少:"))
# #输入单价
# dj = int(input("请输入本子的单价:"))
# #输入买了多少
# sl = int(input("请输入买了多少本:"))
# #计算买本的钱数
# zj = dj * sl
# #比较是否够买,够输出True 不够输出FALSE
# print(a>=zj)
# #画四个圆
# import turtle
# turtle.circle(40)
# turtle.circle(-40)
# turtle.forward(80)
# turtle.circle(40)
# turtle.circle(-40)
# turtle.done()
import
turtle
pen_color
=
[
'red'
,
'blue'
,
'orange'
,
'green'
]
length
=
15
jd
=
90
i
=
1
n
=
int
(
input
(
'请输入一共画出多少条边'
))
while
i
<
n
+
1
:
turtle
.
pencolor
(
pen_color
[
i
%
4
])
turtle
.
forward
(
length
)
turtle
.
left
(
jd
)
length
=
length
+
5
i
=
i
+
1
turtle
.
done
()
05
09
16
25
26
33
+
03
07
\ 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