Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What are the functions of int and% in python language? What is the difference?
What are the functions of int and% in python language? What is the difference?
Int is a class in python, which means shaping. For example, 1, 2 and 3 are all int shapes in python.

It can be directly a= 1, in which case a is an int variable;

Or s=int( 1), the effect is the same as above.

In the command output on the screen,% is a format symbol, %d is an integer and %s is a character.

Looking at% alone is an operation symbol, find the remainder.

1%5 = 1, 2%5 = 2, 3%5 = 3, 4%5 = 4, 5%5 = 0

Another simple use is to judge whether one number can be divisible by another by the result of operation.