Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-5_DIY1
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
5d811a1a
authored
Mar 27, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
82e90186
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
96 additions
and
28 deletions
diy1.py
圆.py
小贝.py
是.py
爱心.py/12.py
爱心.py/13.py
爱心.py/14.py
爱心.py/15.py
爱心.py/17.py
爱心.py/18.py
爱心.py/19.py
爱心.py/20.py
菜单.py
diy1.py
View file @
5d811a1a
...
@@ -7,6 +7,8 @@ pen.hideturtle()
...
@@ -7,6 +7,8 @@ pen.hideturtle()
screen
=
turtle
.
Screen
()
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"purple"
)
screen
.
bgcolor
(
"purple"
)
pen1
=
turtle
.
Pen
()
pen1
=
turtle
.
Pen
()
pen1
.
penup
()
pen1
.
penup
()
pen1
.
goto
(
-
100
,
0
)
pen1
.
goto
(
-
100
,
0
)
...
...
圆.py
View file @
5d811a1a
import
turtle
++ "b/\345\234\206.py"
import
turtle
zhouchang
=
random
circle
\ No newline at end of file
小贝.py
View file @
5d811a1a
a
=
int
(
input
(
"请输入数字:"
))
a
=
int
(
input
(
"请输入数字:"
))
...
@@ -4,4 +4,12 @@ if a==1 or a==3 or a==5:
...
@@ -4,4 +4,12 @@ if a==1 or a==3 or a==5:
elif
a
>
7
:
elif
a
>
7
:
print
(
"输入错误,请输入1~7之间的数字"
)
print
(
"输入错误,请输入1~7之间的数字"
)
else
:
else
:
print
(
"YES"
)
print
(
"YES"
)
\ No newline at end of file
chr
()
#转化为字符
ord
()
#
math
#
math
.
print
#
math
.
ceil
()
#
math
.
sqrt
()
#
\ No newline at end of file
是.py
0 → 100644
View file @
5d811a1a
def
hello
(
name
):
def
hello
(
name
):
content
=
"你好!"
+
name
return
content
result
=
hello
(
"小依"
)
print
(
result
)
\ No newline at end of file
爱心.py/12.py
View file @
5d811a1a
a
=
int
(
input
(
"请输入一个数字:"
))
#a=int(input("请输入一个数字:"))
a
=
int
(
input
(
"请输入一个数字:"
))
#a=int(input("请输入一个数字:"))
print
(
chr
(
a
))
#print(chr(a))
#b=input("请输入一个字符:")
#print(ord(b))
for
i
in
range
(
48
,
123
):
print
(
i
,
chr
(
i
))
\ No newline at end of file
爱心.py/13.py
View file @
5d811a1a
h
=
int
(
input
(
"请输入圆桶的深度H:"
))
import
math
import
math
PI
=
a
=
math
.
pi
h
=
int
(
input
(
"请输入圆桶的深度H:"
))
h
=
int
(
input
(
"请输入圆桶的深度H:"
))
r
=
int
(
input
(
"请输入底面半径R:"
))
r
=
int
(
input
(
"请输入底面半径R:"
))
V
=
3.14159
*
r
*
r
*
h
V
=
PI
*
r
*
r
*
h
C
=
V
%
20
C
=
V
/
1000
C
=
math
.
ceil
(
C
)
print
(
C
)
print
(
C
)
\ No newline at end of file
爱心.py/14.py
View file @
5d811a1a
a
=
int
(
input
(
"请输入端点坐标A:"
))
import
math
a
=
int
(
input
(
"请输入端点坐标A:"
))
import
math
b
=
int
(
input
(
"请输入端点坐标B:"
))
Xa
=
int
(
input
(
"a"
))
\ No newline at end of file
Xb
=
int
(
input
(
"a"
))
Ya
=
int
(
input
(
"a"
))
Yb
=
int
(
input
(
"a"
))
a
=
(
Xb
-
Xa
)
*
(
Xb
-
Xa
)
+
(
Yb
-
Ya
)
*
(
Yb
-
Ya
)
print
(
math
.
sqrt
(
a
))
爱心.py/15.py
View file @
5d811a1a
-- "a/\347\210\261\345\277\203.py/15.py"
import
turtle
import
turtle
x1
=
int
(
input
(
"a"
))
x2
=
int
(
input
(
"a"
))
x3
=
int
(
input
(
"a"
))
y1
=
int
(
input
(
"a"
))
y2
=
int
(
input
(
"a"
))
y3
=
int
(
input
(
"a"
))
a
=
print
(
a
)
爱心.py/17.py
View file @
5d811a1a
-- "a/\347\210\261\345\277\203.py/17.py"
n
=
int
(
input
(
"请输入箱内苹果的个数:"
))
n
=
int
(
input
(
"请输入箱内苹果的个数:"
))
x
=
int
(
input
(
"请输入x:"
))
y
=
int
(
input
(
"请输入完整苹果个数:"
))
y
=
n
-
x
print
(
y
)
\ No newline at end of file
爱心.py/18.py
View file @
5d811a1a
-- "a/\347\210\261\345\277\203.py/18.py"
a
=
int
(
input
(
"a"
))
a
=
int
(
input
(
"a"
))
b
=
int
(
input
(
"b"
))
c
=
int
(
input
(
"c"
))
print
(
"Data Error"
)
if
a
*
b
/
2
=
d
print
(
d
)
\ No newline at end of file
爱心.py/19.py
View file @
5d811a1a
-- "a/\347\210\261\345\277\203.py/19.py"
A
=
int
(
input
(
"a"
))
A
=
int
(
input
(
"a"
))
if
A
>
0
:
print
(
"positive"
)
if
A
=
0
:
print
(
"zero"
)
if
A
<
0
:
print
(
"negative"
)
\ No newline at end of file
爱心.py/20.py
View file @
5d811a1a
-- "a/\347\210\261\345\277\203.py/20.py"
b
=
input
(
"请输入字符:"
)
b
=
input
(
"请输入字符:"
)
c
=
ord
(
b
)
if
0
!=
c
%
2
:
print
(
"YES"
)
else
:
print
(
"NO"
)
\ No newline at end of file
菜单.py
View file @
5d811a1a
def
n
ew_input
():
def
n
ew_input
():
...
@@ -6,10 +6,11 @@ def new_input():
...
@@ -6,10 +6,11 @@ def new_input():
if
b
==
'q'
:
if
b
==
'q'
:
break
break
b
=
int
(
b
)
b
=
int
(
b
)
except
:
except
:
print
(
"请输入数字:"
)
print
(
"请输入数字:"
)
else
:
else
:
a
.
append
(
b
)
a
.
append
(
b
)
return
a
return
a
print
(
a
)
result
=
new_input
(
a
)
new_input
()
print
(
result
)
\ No newline at end of file
\ 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