Test bool value conv.
This commit is contained in:
parent
399ddc8ffd
commit
75013adb20
25
main.py
25
main.py
@ -1,8 +1,17 @@
|
|||||||
#String tests
|
#Bool tests
|
||||||
a = " !{} {}! "
|
print(bool(None))
|
||||||
b = " !{1} {0}! "
|
print(bool("abc"))
|
||||||
c = "hello"
|
print(bool(1))
|
||||||
d = "world"
|
print(bool(0))
|
||||||
print(a.format(c, d))
|
print(int(False))
|
||||||
print(b.format(c, d))
|
print(int(True))
|
||||||
print(b.format(d, c, a))
|
x = ""
|
||||||
|
print(bool(x))
|
||||||
|
x = None
|
||||||
|
print(bool(x))
|
||||||
|
x = 0j
|
||||||
|
print(bool(x))
|
||||||
|
def dummy():
|
||||||
|
pass
|
||||||
|
print(dummy)
|
||||||
|
print(dummy())
|
||||||
|
Loading…
Reference in New Issue
Block a user