python: check if a variable is a integer









if isinstance(var, int):
print("It is integer")
On python 2:

if is instance(var, (int, long)):
print("It is integer")



No comments:

Post a Comment