Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 如果数字不完整,如何打印python 3.5.7_Python 3.x - Fatal编程技术网

Python 3.x 如果数字不完整,如何打印python 3.5.7

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:?可能存在的副本

我正在尝试编写一个程序,其中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:?可能存在的副本