Six types of data in python

The data type is the element

Elements start at 0 on the left and -1 on the right

 

mutable data type

list

(123,dfjk)

 

dictionary

 

Immutable data types

tuple

(dkjf, 123)  

 

set

[sdlkf,123]

 

number

Four types of values: 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])

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325526157&siteId=291194637