You are on page 1of 2

>>> #1-------------------------------------

>>> 0.1 + 0.2 == 0.3


False

>>> #2-------------------------------------
>>> 6//'r'
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
6//'r'
TypeError: unsupported operand type(s) for //: 'int' and 'str'

>>> #3-------------------------------------
>>> -5//3.0
-2.0

>>> #4-------------------------------------
>>> 'carcar' - 'car'
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
'carcar' - 'car'
TypeError: unsupported operand type(s) for -: 'str' and 'str'

>>> #5-------------------------------------
>>> 4 + (5 - (11 // 5))** 3 % 4
7

>>> #6-------------------------------------
>>> 4**2>6<=(6+0)
True

>>> #7-------------------------------------
>>> 50*2/4//3%2
0.0

>>> #8-------------------------------------
>>> 2**3**2
512

>>> #9-------------------------------------
>>> 4+5j*3+2j
(4+17j)

>>> #10------------------------------------
>>> (20+25j)//(4+5j)
Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
(20+25j)//(4+5j)
TypeError: can't take floor of complex number.

>>> #11------------------------------------
>>> (2+6j)**2
(-32+24j)

>>> #12------------------------------------
>>> 4+5j**2
(-21+0j)

>>> #13------------------------------------
>>> 0%0
Traceback (most recent call last):
File "<pyshell#25>", line 1, in <module>
0%0
ZeroDivisionError: integer division or modulo by zero

>>> #14------------------------------------
>>> 5.0**0
1.0

>>> #15------------------------------------
>>> 0**2.3
0.0

>>> #16------------------------------------
>>> type(float('inf'))
<class 'float'>

>>> #17------------------------------------
>>> float('inf')-float('-inf')
inf

>>> #18------------------------------------
>>> float('inf')<520.0
False

>>> #19------------------------------------
>>> 4.5/float('inf')
0.0

>>> #20------------------------------------
>>> 0/float('inf')
0.0

>>> #21------------------------------------
>>> float(‘inf’)**0
SyntaxError: invalid character '‘' (U+2018)
>>> float('inf')**0
1.0

>>> #22------------------------------------
>>> 4>=3 or 2==5
True

>>> #23------------------------------------
>>> not(3 < 5 and 2 < 10)
False

>>> #24------------------------------------
>>> 1|2&3|4
7

>>> #25------------------------------------
>>> 0^4 == 4^0
True
>>>

You might also like