013_Python——数据类型转换
作者:互联网
# int 有符号整数
# float 浮点型
# boolean 布尔类型
# string 字符串
# list 列表
# tuple 元组
# dict 字典
a = '123'
print(type(a))
b = int(a)
print(type(b))
a = 1.23
print(type(a))
b = int(a)print(type(b))
# boolean--->转换为int
# true--->1 false--->0
a = True
print(type(a))
b = int(a)
print(b)
print(type(b))
a = False
print(type(a))
b = int(a)
print(b)
print(type(b))
标签:类型转换,false,Python,---,int,013,boolean,print,type 来源: https://blog.csdn.net/m0_62530644/article/details/123628902