2025-04-20 23:22:14 +08:00

11 lines
795 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 三、列表、元组和字典
本章节我们来介绍另外几种十分常用的数据类型:列表、元组和字典。
为什么我们需要他们呢?
之前我们学习的数据类型基本上都是存储单个数据的当我们有1~10这10个数字的时候难道我们需要定义10个变量吗即使定义了你都记得住变量名吗100个数据、1000个数据呢
因此这样思考下来,我们之前的数据类型可能还不够,在实际编程的过程中,很大可能需要通过某个变量来批量保存大量的数据,而列表、元组和字典就能满足这样的需求。这些数据类型在我们日常的编程中也常常用到,都是必知必会的内容。
想知道它们是什么怎么用吗?快来跟我一起学习吧!