You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
246 B
18 lines
246 B
4 years ago
|
# tests for bool objects
|
||
|
|
||
|
# basic logic
|
||
|
print(not False)
|
||
|
print(not True)
|
||
|
print(False and True)
|
||
|
print(False or True)
|
||
|
|
||
|
# unary operators
|
||
|
print(+True)
|
||
|
print(-True)
|
||
|
|
||
|
# unsupported unary op
|
||
|
try:
|
||
|
len(False)
|
||
|
except TypeError:
|
||
|
print('TypeError')
|