-2

i am trying to write a program where the print statement will print only if the number is not a whole number.

if (yr/4) #is not a whole number

print("this is not a whole number")

1 Answers1

-1
num = # any number here

if int(num) != num: # check if number is not whole (same if you truncate)
    print('Not a whole number')

This should do the trick

hhaefliger
  • 521
  • 3
  • 18