3-4 tipo booleano de Python

 

 

# Enter a code

print(True and True )
print(False and False )
print(False and True)
print(True and False)
print(True and True)

print("==============")

print(True or True)
print(True or False)
print(False or True)
print(False or False)

print("==============")

print(not True)
print(not False)

print("==============")

a = 'python'
print('hello', a or 'world')
b = ''
print('hello', b or 'world')

imprimir:

True
False
False
False
True
==============
True
True
True
False
==============
False
True
==============
('hello', 'python')
('hello', 'world')

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Supongo que te gusta

Origin blog.csdn.net/huanglianggu/article/details/115050395
Recomendado
Clasificación