python之数据六种类型

数据类型里面的是元素

元素左边从0开始,右边从-1开始

可变数据类型

list

(123,dfjk)

dictionary

不可变数据类型

tuple

(dkjf,123)  

set

[sdlkf,123]

number

数值四种类型:int,float,bool,complex      

>>>a, b, c, d = 20, 5.5, True, 4+3j >>> print(type(a), type(b), type(c), type(d)) <class 'int'> <class 'float'> <class 'bool'> <class 'complex'>

string

str = 'Runoob'

(str[1:-1])

猜你喜欢

转载自www.cnblogs.com/capable/p/9001959.html
今日推荐