日期:2025/04/05 22:55来源:未知 人气:51
分享兴趣,传播快乐,增长见闻,留下美好!
亲爱的您,这里是LearningYard新学苑。
今天小编为大家带来“Python入门指南”,欢迎您的访问。
Share interest, spread happiness, increase knowledge, and leave beautiful.
Dear, this is the LearingYard Academy!
Today, the editor brings in-depth python language (5) —— Combined ,welcome to visit!
一、序列类型
序列类型是一维元素向量,元素之间存在先后关系,通过序号访问。序列的基本思想和表达方式均源于数学概念。在数学中,经常给每个序列一个名字,例如,n个数的序列S:s1,s2,s3……sn-1。需要访问某个值的时候,通过下标即可完成。
A sequence type is a vector of one-dimensional elements, and there is a sequence relation between the elements, which is accessed by sequence number. The basic idea and expression of sequence are derived from mathematical concepts. In mathematics, it is common to give each sequence a name, for example, the sequence of n numbers S: s1, s2, s3... sn-1. When you need to access a value, you can do it by subscripting.
二、集合类型
集合中的元素不能重复,元素类型只能固定是数据变量,例如整数、浮点数、字符串、元组等,列表、字典和集合本身都是可变数据类型,不能作为集合的元素。
The elements in the collection cannot be repeated, and the element types can only be fixed data variables, such as integers, floating point numbers, strings, tuples, etc. Lists, dictionaries, and the collection itself are variable data types and cannot be used as elements of the collection.
三、映射类型
映射类型是“键—值”数据的组合,每个元素都是一个键值对。键表示一个属性,也可以理解为一个类别或项目,值是属性的内容,键值对刻画了一个属性和它的值。通过键来获取值,通过键来记录值等。
A mapping type is a combination of key-value data, where each element is a key-value pair. A key represents an attribute, which can also be understood as a category or item, a value is the content of an attribute, and a key-value pair characterizes an attribute and its value. Get values by keys, record values by keys, and so on.
今天的分享就到这里了,
如果您对文章有独特的想法,
欢迎给我们留言。
让我们相约明天,
祝您今天过得开心快乐!
That's all for today's sharing.
If you have a unique idea about the article,
please leave us a message,
and let us meet tomorrow.
I wish you a nice day!
参考资料
《Python语言程序设计基础》
翻译:网易有道翻译
本文由LearningYard学苑整理并发出,如有侵权请后台留言沟通.
文案|Dongyang
排版|Dongyang
审核|hong
Learning Yard 新学苑