Python基础学习(二)基本数据类型

Python基础学习(二)基本数据类型

本篇文章主要介绍python的基本数据类型。
Python3 中有六个标准的数据类型:
Number(数字)
String(字符串)
List(列表)
Tuple(元组)
Set(集合)
Dictionary(字典)

数字

数字较为简单,包括整形,浮点型,布尔型,复数。
我们可以利用type去判断它的数据类型。

a,b,c,d = 20,True,2.12,1+2j
print(a,b,c,d)
>>>20 True 2.12 (1+2j)
print(type(a),type(b),type(c),type(d))
发布了140 篇原创文章 · 获赞 26 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/CLOUD_J/article/details/89229489