converts the given value to a Boolean value ( True or False ). | python bool function| python course

Publicado el: 08 diciembre 2021
en el canal de: thepycode
377
50

#python #Boolean #pythoncourse
converts the given value to a boolean value ( True or False ).
bool function in the python
Boolean
1)
   • Boolean in python | python tutorials | Bes...  
Facebook link:
  / 976594952928573  

empty list
mylist = []
print(mylist,'is',bool(mylist))

empty tuple
t = ()
print(t,'is',bool(t))

zero complex number
a = 0 + 0j
print(a,'is',bool(a))

num = 55
print(num, 'is', bool(num))
val = None
print(val,'is',bool(val))

val = True
print(val,'is',bool(val))

empty string
str = ''
print(str,'is',bool(str))

str = 'Hello'
print(str,'is',bool(str))


En esta página del sitio puede ver el video en línea converts the given value to a Boolean value ( True or False ). | python bool function| python course de Duración hora minuto segunda en buena calidad , que subió el usuario thepycode 08 diciembre 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 377 veces y le gustó 50 a los espectadores. Disfruta viendo!