Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_1
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
896e14ed
authored
Jan 26, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
73425e1b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
65 deletions
1.py
2.py → 111.py
11.py → 222.py
3.py → 333.py
__pycache__/test.cpython-37.pyc
com.py
func.py
test.py
1.py
deleted
100644 → 0
View file @
73425e1b
#第一关创建函数
def
n_w
():
total
=
[]
while
True
:
unit
=
input
(
"请输入:"
)
if
unit
==
'q'
:
break
else
:
try
:
unit
=
int
(
unit
)
except
:
print
(
"number:"
)
else
:
total
.
append
(
unit
)
return
total
a
=
n_w
()
print
(
a
)
2
.py
→
111
.py
View file @
896e14ed
...
@@ -5,14 +5,7 @@ def n_w():
...
@@ -5,14 +5,7 @@ def n_w():
if
unit
==
'q'
:
if
unit
==
'q'
:
break
break
else
:
else
:
# total.append(unit)
total
.
append
(
unit
)
try
:
print
(
total
)
unit
=
int
(
unit
)
n_w
()
except
:
print
(
"请重新输入一个数字"
)
else
:
total
.
append
(
unit
)
return
total
a
=
n_w
()
print
(
a
)
11
.py
→
222
.py
View file @
896e14ed
File moved
3.py
→
3
33
.py
View file @
896e14ed
...
@@ -2,20 +2,26 @@ def n_w():
...
@@ -2,20 +2,26 @@ def n_w():
total
=
[]
total
=
[]
while
True
:
while
True
:
unit
=
input
(
"请输入:"
)
unit
=
input
(
"请输入:"
)
if
unit
==
'q'
:
if
unit
==
'q'
or
unit
==
'Q'
:
break
break
else
:
else
:
# total.append(unit)
try
:
try
:
unit
=
int
(
unit
)
unit
=
int
(
unit
)
except
:
except
:
print
(
"请重新输入一个数字"
)
print
(
"请重新输入一个数字"
)
else
:
else
:
total
.
append
(
unit
)
total
.
append
(
unit
)
# print(total)
return
total
return
total
a
=
n_w
()
# a = n_w()
print
(
a
)
# print(a)
#第四关:计算总价
#第四关:计算总价
...
...
__pycache__/test.cpython-37.pyc
View file @
896e14ed
No preview for this file type
com.py
View file @
896e14ed
...
@@ -35,6 +35,7 @@ p.end_fill()
...
@@ -35,6 +35,7 @@ p.end_fill()
p
.
penup
()
p
.
penup
()
p
.
goto
(
0
,
50
)
p
.
goto
(
0
,
50
)
p
.
pendown
()
p
.
pendown
()
#内切三角形的边长
#内切三角形的边长
len
=
(
math
.
sqrt
(
3
))
*
50
len
=
(
math
.
sqrt
(
3
))
*
50
p
.
right
(
60
)
p
.
right
(
60
)
...
...
func.py
deleted
100644 → 0
View file @
73425e1b
# def a():
# total = []
# while True:
# unit= input("请输入:")
# if unit== 'q':
# break
# else:
# total.append(unit)
# print(total)
# a()
try
:
age
=
int
(
input
(
"年龄:"
))
except
:
print
(
"要输入整数啊"
)
else
:
if
age
<
18
:
print
(
"你可以喝酒哦~"
)
print
(
"哇哦"
)
\ No newline at end of file
test.py
View file @
896e14ed
...
@@ -7,8 +7,7 @@ def n_w():
...
@@ -7,8 +7,7 @@ def n_w():
break
break
else
:
else
:
total
.
append
(
unit
)
total
.
append
(
unit
)
print
()
print
()
n_w
()
n_w
()
...
...
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