Article From:https://www.cnblogs.com/rice-li/p/9564778.html

number

1.int(Integral type)

2. long(Long integer)

3.float(Floating-point type

4.complex(Plural)

 Boolean value

1.True or false

1Or 0

Character string

Knowledge supplement

String to binary

mes = "Hello, Beijing"
print(mes.encode(“utf-8”))#encode()Add encoding type

Output:

b'\xe5\x8c\x97\xe4\xba\xac\xe4\xbd\xa0\xe5\xa5\xbd'

Binary to string

1 mes = "Hello, Beijing"
2 print(mes.encode("utf-8").decode("utf-8"))

Output:

 

Link of this Article: DAY2: data type Python3.6

Leave a Reply

Your email address will not be published. Required fields are marked *