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")
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")
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