1def is_number(x):
2 '''
3 Takes a word and checks if Number (Integer or Float).
4 '''
5 try:
6 # only integers and float converts safely
7 num = float(x)
8 return True
9 except ValueError as e: # not convertable to float
10 return False