<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>python-flow归档 - 帝讯博客</title>
	<atom:link href="https://www.dixunblog.cn/tag/python-flow/feed" rel="self" type="application/rss+xml" />
	<link>https://www.dixunblog.cn/tag/python-flow</link>
	<description>致力于打造专业的互联网资讯平台</description>
	<lastBuildDate>Mon, 06 Apr 2026 00:30:07 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://cdn.hyclive.cn/dixunblog/2025/12/cropped-ico-32x32.png</url>
	<title>python-flow归档 - 帝讯博客</title>
	<link>https://www.dixunblog.cn/tag/python-flow</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Python 条件判断与循环语句 &#8211; 实战篇</title>
		<link>https://www.dixunblog.cn/1568.html</link>
					<comments>https://www.dixunblog.cn/1568.html#respond</comments>
		
		<dc:creator><![CDATA[小编]]></dc:creator>
		<pubDate>Mon, 06 Apr 2026 00:30:07 +0000</pubDate>
				<category><![CDATA[技术教程]]></category>
		<category><![CDATA[Python 教程]]></category>
		<category><![CDATA[python-flow]]></category>
		<category><![CDATA[代码教程]]></category>
		<guid isPermaLink="false">https://www.dixunblog.cn/1568.html</guid>

					<description><![CDATA[<p>欢迎来到今天的 Python 基础教程！今天我们来深入讲解 Python 条件判断与循环语句。</p>
<p>一、条件判断</p>
<p>1.1 if 语句<br />
<code class="language-python">age = 18</p>
<p>if age &#62;= 18:<br />
    print("成年人")<br />
else:<br />
    print("未成年人"...</p>
<p><a href="https://www.dixunblog.cn/1568.html">Python 条件判断与循环语句 &#8211; 实战篇</a>最先出现在<a href="https://www.dixunblog.cn">帝讯博客</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>欢迎来到今天的 Python 基础教程！今天我们来深入讲解 Python 条件判断与循环语句。</p>
<h2>一、条件判断</h2>
<h3>1.1 if 语句</h3>
<pre><code class="language-python">age = 18

if age &gt;= 18:
    print("成年人")
else:
    print("未成年人")</code></pre>
<h3>1.2 elif 多条件</h3>
<pre><code class="language-python">score = 85

if score &gt;= 90:
    print("优秀")
elif score &gt;= 80:
    print("良好")
elif score &gt;= 60:
    print("及格")
else:
    print("不及格")</code></pre>
<h2>二、循环语句</h2>
<h3>2.1 for 循环</h3>
<pre><code class="language-python"># 遍历列表
fruits = ["苹果", "香蕉", "橙子"]
for fruit in fruits:
    print(fruit)

# 范围循环
for i in range(5):
    print(i)  # 0 到 4</code></pre>
<h3>2.2 while 循环</h3>
<pre><code class="language-python">count = 0
while count &lt; 5:
    print(count)
    count += 1</code></pre>
<h2>三、循环控制</h2>
<pre><code class="language-python"># break - 跳出循环
for i in range(10):
    if i == 5:
        break
    print(i)  # 0-4

# continue - 跳过本次
for i in range(5):
    if i == 3:
        continue
    print(i)  # 0,1,2,4</code></pre>
<h2>四、实战示例</h2>
<pre><code class="language-python"># 猜数字游戏
import random

number = random.randint(1, 100)
guess = 0

while guess != number:
    guess = int(input("猜一个 1-100 的数字："))
    if guess &gt; number:
        print("太大了")
    elif guess &lt; number:
        print(&quot;太小了&quot;)
    else:
        print(&quot;猜对了！&quot;)</code></pre>
<h2>五、总结</h2>
<p>条件判断和循环是编程的基础。建议多练习。</p>
<hr>
<p><em>关注我们获取更多 Python 教程！</em></p>
<p><a href="https://www.dixunblog.cn/1568.html">Python 条件判断与循环语句 &#8211; 实战篇</a>最先出现在<a href="https://www.dixunblog.cn">帝讯博客</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dixunblog.cn/1568.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
