0

I am currently working on some code to tell wether my users input is a float or integer but it doesn't seem to be working can anyone help?

 number = input ("Enter something:")
 if type(number) != int:  
      print("Isn't a whole number")
 else:
      print("is a whole number")
Sophie
  • 9
  • 1

1 Answers1

-1

Use is for type checking, ie not type(a) is int

CamJohnson26
  • 1,119
  • 1
  • 15
  • 40