首页 > 编程语言 >Python第三天

Python第三天

时间:2023-03-02 09:03:21浏览次数:39  
标签:false Python float 第三天 int str 数字串 true

8bit(位)=1byte(字节)1024byte=1kb
str表示字符串(只要是双单引号里的都叫字符串)
int表示整数(1、2、3、5)
float表示浮点数(3.151) type()数据类型
bool表示true,false

int()、str()、float() 可以互相转换
(1)将str转换成int类型时,字符串必须是数字串(整数),非数字串转化报错
(2)将float转化成int类型时,向下取整
(3)将bool转换成int类型时,true=1、false=0
(4)将int转为float时末尾会加上.0,true=1.0、false=0.0
(5)非数字串类的无法转换
input('')无论输入什么数据,结果都是str类型

标签:false,Python,float,第三天,int,str,数字串,true
From: https://www.cnblogs.com/zjt1400700608/p/17170567.html

相关文章