I want check a type of a number in python, for example
x=4
y=2
type(x/y) == type(int)
--> False
it has to be True but what python makes is, it takes 4/2 as 2.0.
2.0 is a floating number, how can I make 2.0 to 2 but at the same time I don't want to make 2.5 to 2 for example :
x=5
y=2
type(x/y) == type(int)
--> False
This is what I want. In conclusion I need something that can understand if a number is int or a floating number after a division operation. Can you help me please
type(int)returns<type 'type'>not<type 'int'>x % y == 0if x is divisible by y.