<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>列表 on 老张开工了</title>
    <link>/%E5%88%97%E8%A1%A8/</link>
    <description>Recent content in 列表 on 老张开工了</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Tue, 05 May 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="/%E5%88%97%E8%A1%A8/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>列表与元组详解</title>
      <link>/posts/2026/05/list-tuple/</link>
      <pubDate>Tue, 05 May 2026 00:00:00 +0000</pubDate>
      <guid>/posts/2026/05/list-tuple/</guid>
      <description>前面我们学习了字符串，它是 Python 中的一种序列类型。今天我们将学习另外两种非常重要的序列类型——列表和元组。它们可以存储多个元素，是 Python 编程中使用最频繁的数据结构之一。&#xA;列表（List） 列表是 Python 中最灵活、最常用的序列类型。它是一个有序、可变的容器，可以存储任意类型的元素。&#xA;创建列表 # 创建列表的几种方式 empty_list = [] # 空列表 numbers = [1, 2, 3, 4, 5] # 整数列表 mixed = [1, &amp;#34;hello&amp;#34;, 3.14, True] # 混合类型 nested = [[1, 2], [3, 4], [5, 6]] # 嵌套列表（二维） # 使用 list() 构造 chars = list(&amp;#34;Python&amp;#34;) # [&amp;#39;P&amp;#39;, &amp;#39;y&amp;#39;, &amp;#39;t&amp;#39;, &amp;#39;h&amp;#39;, &amp;#39;o&amp;#39;, &amp;#39;n&amp;#39;] range_list = list(range(5)) # [0, 1, 2, 3, 4] # 列表推导式（创建列表的简洁方式） squares = [x ** 2 for x in range(10)] # [0, 1, 4, 9, .</description>
    </item>
  </channel>
</rss>
