0 votes
by (120 points)
How do you check if it is a number in Python?

1 Answer

0 votes
by (1.3k points)
Use isinstance() to check if a number is an int or float

Call isinstance(object, classinfo) with the number as object and classinfo as either int or float to return True if object is an instance of classinfo and False otherwise.

Related questions

0 votes
1 answer
0 votes
1 answer
asked May 28, 2021 by multimeter (760 points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 19, 2021 by blown (120 points)
0 votes
1 answer
...