This website requires JavaScript.
Explore
Help
Register
Sign In
chenxuan
/
python
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
f73d5deacbbd1015939aaac00c3a7a3e2df78cd0
python
/
pythonProject
/
循环语句
/
for
/
for4.py
T
7 lines
153 B
Python
Raw
Normal View
History
Unescape
Escape
no message
2024-01-01 16:50:40 +08:00
s
=
0
no message
2026-10-09 11:30:57 +08:00
for
i
in
range
(
1
,
101
):
no message
2024-01-01 16:50:40 +08:00
s
+=
i
else
:
print
(
s
)
555
2026-05-18 00:23:41 +08:00
# 在 Python 中,
# for 循环可以跟一个 else 子句,它在循环正常结束时执行。
Reference in New Issue
Copy Permalink