技术栈
python中的循环结构
^南波万^
2024-09-10 8:39
注意:range()函数
累加和:
注意:if 下面如果有好几行,只执行一行
print必须和 for 开头相同格数
例题:水仙花数
注意在print语句中,一句好" 。。。。。 "后面必须有逗号然后再写变量名,否则会报错
无限循环while
用while来累加输出结果
while 扩展结构
(与前一个进行对比,只要循环语句没有中断的情况下,可以使用else 来进行最终需要的输出)
循环+分支结构
循环结构的嵌套
输出图形
长方形和直角三角形的输出
python
上一篇:
MS office 难题
下一篇:
【编程基础知识】Spring Boot自动装配机制的实现原理
相关推荐
aqi00
1 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能
·
python
·
大模型
·
ai编程
·
ai应用
金銀銅鐵
3 小时前
用 Python 实现 Take-Away 游戏
python
·
游戏
copyer_xyf
3 小时前
Agent 流程编排
后端
·
python
·
agent
copyer_xyf
4 小时前
Agent RAG
后端
·
python
·
agent
copyer_xyf
4 小时前
【RAG】向量数据库:milvus
后端
·
python
·
agent
copyer_xyf
4 小时前
Agent 记忆管理
后端
·
python
·
agent
星云穿梭
19 小时前
用Python写一个带图形界面的学生管理系统——完整教程
python
金銀銅鐵
20 小时前
用 Pygame 实现 15 puzzle
python
·
数学
·
游戏
黄忠
1 天前
大模型之LangGraph技术体系
python
·
llm
热门推荐
01
2026年6月AI行业全景:从百模大战到Agent元年,这30天发生了什么?
02
2026年6月AI大模型全景报告:GPT-5.6、Claude Opus 4.8、Gemini 3.5,中美AI三足鼎立谁主沉浮?
03
2026 年 AI 编程工具终极横评:Cursor vs Claude Code vs Copilot vs Windsurf
04
【AI】2026 年具身智能模型和世界模型总结
05
GitHub 镜像站点
06
AI科技热点日报 | 2026年6月1日
07
2026 AI 编程工具终极实战指南:Cursor vs Claude Code vs Copilot,开发者该怎么选?
08
AI一周事件 · 2026-06-03 至 2026-06-09
09
Claude Code、Codex、Cursor三分天下:2026年AI编程Agent生态全景剖析
10
上线仅72小时被强制下架:Claude Fable 5 的短命