Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_6
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
8d3c0fb9
authored
Oct 22, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4c87931c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
25 deletions
2.py/2.py
2.py/3.py
2.py/4.py
2.py/5.py
diy4.py
2.py/2.py
0 → 100644
View file @
8d3c0fb9
import
turtle
as
t
t
.
penup
()
t
.
goto
(
0
,
-
200
)
t
.
pendown
()
t
.
circle
(
200
)
t
.
penup
()
t
.
goto
(
-
100
,
50
)
t
.
pendown
()
t
.
fillcolor
(
"blue"
)
t
.
begin_fill
()
t
.
circle
(
20
)
t
.
end_fill
()
t
.
penup
()
t
.
goto
(
100
,
50
)
t
.
pendown
()
t
.
fillcolor
(
"blue"
)
t
.
begin_fill
()
t
.
circle
(
20
)
t
.
end_fill
()
t
.
penup
()
t
.
goto
(
0
,
50
)
t
.
pendown
()
t
.
circle
(
-
50
,
steps
=
3
)
t
.
penup
()
t
.
goto
(
-
150
,
-
70
)
t
.
pendown
()
t
.
goto
(
0
,
-
170
)
t
.
goto
(
150
,
-
70
)
t
.
done
()
\ No newline at end of file
2.py/3.py
0 → 100644
View file @
8d3c0fb9
import
turtle
turtle
.
penup
()
turtle
.
goto
(
-
100
,
100
)
turtle
.
pendown
()
turtle
.
forward
(
200
)
turtle
.
right
(
90
)
turtle
.
forward
(
200
)
turtle
.
right
(
90
)
turtle
.
forward
(
200
)
turtle
.
right
(
90
)
turtle
.
forward
(
200
)
turtle
.
right
(
90
)
turtle
.
penup
()
turtle
.
goto
(
0
,
0
)
turtle
.
dot
(
20
,
"red"
)
turtle
.
penup
()
turtle
.
goto
(
-
40
,
0
)
turtle
.
dot
(
20
,
"red"
)
turtle
.
goto
(
40
,
0
)
turtle
.
dot
(
20
,
"red"
)
turtle
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
2.py/4.py
0 → 100644
View file @
8d3c0fb9
'''
计算长方形的面积
并输出结果
'''
#a代表长方形的长
a
=
6
#b代表长方形的宽
b
=
3
#s代表长方形的面积
s
=
a
*
b
print
(
"长方形的面积为;"
,
s
)
\ No newline at end of file
2.py/5.py
0 → 100644
View file @
8d3c0fb9
diy4.py
View file @
8d3c0fb9
import
random
# 私钥
key
=
"abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句
message
=
"诺依,周末一起去看动漫展吧!"
key1
=
"ds7ft45936438637673r03"
key_message
=
""
# 请使用私钥key,对message进行加密
for
i
in
range
(
len
(
message
)):
a
=
message
[
i
]
b
=
random
.
choice
(
key
)
c
=
random
.
choice
(
key
)
d
=
a
+
b
+
c
key_message
=
key_message
+
d
key_message
=
list
(
key_message
)
key_message
.
insert
(
8
,
key1
)
key_message
=
""
.
join
(
key_message
)
print
(
key_message
)
message1
=
list
(
key_message
)
message1
.
insert
(
random
.
randint
(
0
,
len
(
message1
)),
key1
)
message2
=
""
.
join
(
key_message
)
print
(
message2
)
\ No newline at end of file
p
=
3.14
r
=
float
(
input
(
"请输入圆的半径:"
))
zj
=
2
*
r
zc
=
zj
*
r
mj
=
p
*
r
*
r
print
(
"圆的直径为:
%.2
f"
%
zj
)
print
(
"圆的周长为:
%.2
f"
%
zc
)
print
(
"圆的面积为:
%.2
f"
%
mj
)
\ 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