单项选择题
如何解释下面的执行结果()print 1.2-1.0==0.2False
A.Python的实现有错误
B.浮点数无法精确表示
C.布尔运算不能用于浮点数比较
D.Python将非0数视为False
点击查看答案&解析
相关考题
-
单项选择题
用户自定义类时,如果想让该类实例对象被print调用时返回类的特定信息,就必须实现Python魔术方法中的()
A.init
B.str
C.rep
D.cm -
单项选择题
代码print(type([1,2]))输出结果为()
A.<class ’tuple’>
B.<class ’int’>
C.<class ’set’>
D.<class ’list’>
E.<class ’complex’> -
单项选择题
Python 中,以下哪个代码是正确的字典()
A.myExample ={’someItem’=>2,’otherItem’=>20}
B.myExample ={’someItem’:2,’otherItem’:20}
C.myExample =(’someItem’=>2,’otherItem’=>20)
D.myExample =(’someItem’:2,’otherItem’:20)
