数据类型
python
1 | #缩进 |
数据类型
plaintext
1 | python 以类的方式定义数据类型 |
字符串
- 换行字符串
- 字符串索引
- 字符串裁剪
- 字符串长度
- 字符串方法
- 字符串关键字
- 字符串与其他类型组合 使用字符串对象的format方法
布尔值
bool()
python
1 | x = int(8) |
运算符
python
1 | 3 // 2 |
集合
- *列表(List)*是一种有序和可更改的集合。允许重复的成员。
- *元组(Tuple)*是一种有序且不可更改的集合。允许重复的成员。
- *集合(Set)*是一个无序和无索引的集合。没有重复的成员。
- *词典(Dictionary)*是一个无序,可变和有索引的集合。没有重复的成员。
列表 Python 列表 (像数组)
python
1 | my_list = ["a",'b','c'] |
元组
python
1 | my_tuple = ("me",) |
集合(无序)
python
1 | thisset = {"apple", "banana", "cherry"} |
字典
python
1 | #initial |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.