René's URL Explorer Experiment


Title: Python 零基础入门(3/6):条件判断、循环与函数 | wistbean | wistbean

Open Graph Title: Python 零基础入门(3/6):条件判断、循环与函数

X Title: Python 零基础入门(3/6):条件判断、循环与函数

Description: 系统学习 if/elif/else、for/while、break/continue 与函数封装,帮助 Python 新手写出可复用的基础逻辑代码。

Open Graph Description: 系统学习 if/elif/else、for/while、break/continue 与函数封装,帮助 Python 新手写出可复用的基础逻辑代码。

X Description: 系统学习 if/elif/else、for/while、break/continue 与函数封装,帮助 Python 新手写出可复用的基础逻辑代码。

Keywords:

Mail addresses
wistbean.bb@gmail.com

Opengraph URL: https://wistbean.github.io/python-control-flow-functions.html

Generator: Hexo 3.9.0

direct link

Domain: wistbean.github.io


Hey, it has json ld scripts:
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Python 零基础入门(3/6):条件判断、循环与函数",
  "description": "系统学习 if/elif/else、for/while、break/continue 与函数封装,帮助 Python 新手写出可复用的基础逻辑代码。",
  "author": {
    "@type": "Person",
    "name": "wistbean"
  },
  "publisher": {
    "@type": "Organization",
    "name": "wistbean"
  },
  "datePublished": "2026-03-26T11:10:00+08:00",
  "dateModified": "2026-03-26T12:00:00+08:00",
  "mainEntityOfPage": "https://wistbean.org/python-control-flow-functions.html",
  "inLanguage": "zh-CN"
}
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "if、elif、else 的执行顺序是什么?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "从上到下判断,第一个为真的分支会执行,后续分支不会再判断。"
      }
    },
    {
      "@type": "Question",
      "name": "for 和 while 应该怎么选?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "已知迭代范围优先用 for,未知结束条件(如等待输入)更适合用 while。"
      }
    },
    {
      "@type": "Question",
      "name": "函数什么时候需要 return?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "当你需要把计算结果给外部复用时必须 return;若只打印展示可以不返回。"
      }
    }
  ]
}

google-site-verificationbcJVGqEGcBIay29szBsswzqYxY3qUzWuvu1hfad3-08
theme-color#B5963F
og:typearticle
og:site_namewistbean
og:localezh-CN
og:updated_time2026-03-26T02:30:00.000Z
twitter:cardsummary

Links:

javascript:;
https://wistbean.github.io/
Python零基础入门教程 https://wistbean.org/python-tutorial.html
Python爬虫教程 https://mp.weixin.qq.com/mp/appmsgalbum?__biz=Mzg2NzYyNjg2Nw==&action=getalbum&album_id=2448798954764255234#wechat_redirect
加入我的VIP https://vip.fxxkpython.com/?page_id=18
关于我 https://mp.weixin.qq.com/s/m9LVoUdcLTO0YpQom5jjIA
javascript:;
javascript:;
javascript:;
javascript:;
pythonhttps://wistbean.github.io/categories/python/
1. 学习目标速览https://wistbean.github.io/python-control-flow-functions.html#学习目标速览
2. 章节导航https://wistbean.github.io/python-control-flow-functions.html#章节导航
3. 1. 条件判断https://wistbean.github.io/python-control-flow-functions.html#1-条件判断
4. 2. while 循环https://wistbean.github.io/python-control-flow-functions.html#2-while-循环
5. 3. for 循环https://wistbean.github.io/python-control-flow-functions.html#3-for-循环
6. 4. break 与 continuehttps://wistbean.github.io/python-control-flow-functions.html#4-break-与-continue
7. 5. 函数定义与调用https://wistbean.github.io/python-control-flow-functions.html#5-函数定义与调用
8. 6. 参数与返回值https://wistbean.github.io/python-control-flow-functions.html#6-参数与返回值
9. 下一篇https://wistbean.github.io/python-control-flow-functions.html#下一篇
10. 学习 FAQhttps://wistbean.github.io/python-control-flow-functions.html#学习-FAQ
10.1. if、elif、else 的执行顺序是什么?https://wistbean.github.io/python-control-flow-functions.html#if、elif、else-的执行顺序是什么?
10.2. for 和 while 应该怎么选?https://wistbean.github.io/python-control-flow-functions.html#for-和-while-应该怎么选?
10.3. 函数什么时候需要 return?https://wistbean.github.io/python-control-flow-functions.html#函数什么时候需要-return?
11. 系列文章导航https://wistbean.github.io/python-control-flow-functions.html#系列文章导航
pythonhttps://wistbean.github.io/categories/python/
/python-tutorial.htmlhttps://wistbean.github.io/python-tutorial.html
https://wistbean.github.io/python-control-flow-functions.html#学习目标速览
读懂 if/elif/else 分支逻辑https://wistbean.github.io/python-control-flow-functions.html#lesson3-if
掌握 while 与 for 循环场景https://wistbean.github.io/python-control-flow-functions.html#lesson3-while
区分 break 与 continue 用法https://wistbean.github.io/python-control-flow-functions.html#lesson3-break-continue
写出可复用函数与返回值https://wistbean.github.io/python-control-flow-functions.html#lesson3-function
https://wistbean.github.io/python-control-flow-functions.html#章节导航
1. 条件判断https://wistbean.github.io/python-control-flow-functions.html#lesson3-if
2. while 循环https://wistbean.github.io/python-control-flow-functions.html#lesson3-while
3. for 循环https://wistbean.github.io/python-control-flow-functions.html#lesson3-for
4. break 与 continuehttps://wistbean.github.io/python-control-flow-functions.html#lesson3-break-continue
5. 函数定义与调用https://wistbean.github.io/python-control-flow-functions.html#lesson3-function
6. 参数与返回值https://wistbean.github.io/python-control-flow-functions.html#lesson3-params-return
https://wistbean.github.io/python-control-flow-functions.html#1-条件判断
https://wistbean.github.io/python-control-flow-functions.html#2-while-循环
https://wistbean.github.io/python-control-flow-functions.html#3-for-循环
https://wistbean.github.io/python-control-flow-functions.html#4-break-与-continue
https://wistbean.github.io/python-control-flow-functions.html#5-函数定义与调用
https://wistbean.github.io/python-control-flow-functions.html#6-参数与返回值
https://wistbean.github.io/python-control-flow-functions.html#下一篇
Python 入门第四篇:模块、面向对象与异常处理https://wistbean.github.io/python-oop-exceptions.html
https://wistbean.github.io/python-control-flow-functions.html#学习-FAQ
https://wistbean.github.io/python-control-flow-functions.html#if、elif、else-的执行顺序是什么?
https://wistbean.github.io/python-control-flow-functions.html#for-和-while-应该怎么选?
https://wistbean.github.io/python-control-flow-functions.html#函数什么时候需要-return?
https://wistbean.github.io/python-control-flow-functions.html#系列文章导航
总览:Python3 零基础入门教程https://wistbean.github.io/python-tutorial.html
第一篇:安装与第一个程序https://wistbean.github.io/python-quickstart-installation.html
第二篇:变量、数据类型与运算符https://wistbean.github.io/python-basic-syntax-data-types.html
第三篇:条件、循环与函数https://wistbean.github.io/python-control-flow-functions.html
第四篇:模块、面向对象与异常处理https://wistbean.github.io/python-oop-exceptions.html
第五篇:数据结构与文件 IOhttps://wistbean.github.io/python-io-data-structures.html
第六篇:TCP/UDP 网络编程与打包https://wistbean.github.io/python-network-programming.html
wistbean https://wistbean.github.io/python-control-flow-functions.html
wistbean https://wistbean.github.io
pythonhttps://wistbean.github.io/tags/python/
python基础https://wistbean.github.io/tags/python基础/
教程https://wistbean.github.io/tags/教程/
http://service.weibo.com/share/share.php?url=https://wistbean.github.io/python-control-flow-functions.html&title=《Python 零基础入门(3/6):条件判断、循环与函数》 — wistbean&pic=https://wistbean.github.io/img/avatar.jpg
javascript:;
http://connect.qq.com/widget/shareqq/index.html?url=https://wistbean.github.io/python-control-flow-functions.html&title=《Python 零基础入门(3/6):条件判断、循环与函数》 — wistbean&source=wistbean
https://www.facebook.com/sharer/sharer.php?u=https://wistbean.github.io/python-control-flow-functions.html
https://twitter.com/intent/tweet?text=《Python 零基础入门(3/6):条件判断、循环与函数》 — wistbean&url=https://wistbean.github.io/python-control-flow-functions.html&via=https://wistbean.github.io
https://plus.google.com/share?url=https://wistbean.github.io/python-control-flow-functions.html
javascript:;
Prev Python 零基础入门(1/6):安装、环境配置与第一个程序 https://wistbean.github.io/python-quickstart-installation.html
Next Python 零基础入门(5/6):数据结构与文件 IO https://wistbean.github.io/python-io-data-structures.html
https://wistbean.github.io/atom.xml
署名-知识 4.0 (CC BY-NC-SA 4.0)国际协议 | 转载请注明链接出处https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh
肯定会|wistbeanhttps://wistbean.github.io/
通往Python高手之路https://fxxkpython.com
搬瓦工优惠码https://www.bwh8.net/aff.php?aff=32874
vultr优惠码https://www.vultr.com/?ref=7532860
javascript:;
http://service.weibo.com/share/share.php?url=https://wistbean.github.io/python-control-flow-functions.html&title=《Python 零基础入门(3/6):条件判断、循环与函数》 — wistbean&pic=https://wistbean.github.io/img/avatar.jpg
javascript:;
http://connect.qq.com/widget/shareqq/index.html?url=https://wistbean.github.io/python-control-flow-functions.html&title=《Python 零基础入门(3/6):条件判断、循环与函数》 — wistbean&source=wistbean
https://www.facebook.com/sharer/sharer.php?u=https://wistbean.github.io/python-control-flow-functions.html
https://twitter.com/intent/tweet?text=《Python 零基础入门(3/6):条件判断、循环与函数》 — wistbean&url=https://wistbean.github.io/python-control-flow-functions.html&via=https://wistbean.github.io
https://plus.google.com/share?url=https://wistbean.github.io/python-control-flow-functions.html
javascript:;
https://wistbean.github.io/{path}

Viewport: width=device-width, initial-scale=1, maximum-scale=1


URLs of crawlers that visited me.