day3.数据类型

数据类型分类

int :整形数字型,用于计算

bool 布尔值: True,False。 用于用户判断

str 字符型: 存储少量数据进行操作

list 列表:存储大量的数据

元祖:只读。

dict: 字典{'name':'楠楠','age':'18'}

集合:{1,2.3/4,'adfdf'}

数据类型之间的转换

一.int与str之间的转化

 

二.nt,str与bool之间的转化

1,int = 0,bool = false      int ≠ 0 ,bool = ture

2.str为空  bool = false , str非空  bool = ture

原文地址:https://www.cnblogs.com/nannanzuibang/p/9483577.html