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
0bba5f76
authored
Mar 29, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
024fb164
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
9 deletions
func.py
func.py
View file @
0bba5f76
total
=
[]
# total = [] #新建一个空列表
while
True
:
# while True: #重复执行
unit
=
input
(
"请输入:"
)
# unit= input("请输入:") #将用户输入的内容赋值给变量unit
if
unit
==
'q'
:
# if unit== 'q': #如果unit的值为"q"
break
# break #跳出循环
else
:
# else: #否则
total
.
append
(
unit
)
# try:
print
(
total
)
# unit=int()
\ No newline at end of file
# total.append(unit) #将unit的值加入到total列表的末尾
# print(total) #打印出total列表的所有值
a
=
"python"
num
=
int
(
input
(
"请输入需要的打印的次数:"
))
for
i
in
range
(
num
):
print
(
a
)
\ 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