Python syntax - first off

type of data

 

Arithmetic

 

type (data to be queried)

who = 'my'
Action = 'is'
Where do you want = 'mirror of the world'
Number The = 153
code = 'access code'

type(who)
type(action)
type(destination)
type(number)
type(code)

Export

print(type(who))
print(type(action))
print(type(destination))
print(type(number))
print(type(code))

 

Data Conversion

 

# Convert other data types into a string

str () function 

# Convert into other data types Integer

# Text string classes and classes decimals, can not be converted to an integer.

# Floating point to integer conversion, wiping rounding.

int()

# Convert other data types to floating point

float()

 

 

to sum up

 

Guess you like

Origin www.cnblogs.com/AlterMe/p/11078305.html