Python 3.x 如果数字不完整,如何打印python 3.5.7
我正在尝试编写一个程序,其中print语句仅在数字不是整数时才会打印 如果(yr/4)#不是整数Python 3.x 如果数字不完整,如何打印python 3.5.7,python-3.x,Python 3.x,我正在尝试编写一个程序,其中print语句仅在数字不是整数时才会打印 如果(yr/4)#不是整数 num = # any number here if int(num) != num: # check if number is not whole (same if you truncate) print('Not a whole number') 打印(“这不是一个整数”) 如果您的%4!=0:?可能存在的副本
num = # any number here
if int(num) != num: # check if number is not whole (same if you truncate)
print('Not a whole number')
打印(“这不是一个整数”)
如果您的%4!=0:?可能存在的副本