how to check if element is number in python code example
Example 1: if any number python
def num_there(s):
return any(i.isdigit() for i in s)
Example 2: python check if input is a number
user_input = input("Enter something:")
if type(user_input) == int:
return user_input
else:
print("Not a number")