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

Publié le: 08 décembre 2021
sur la chaîne: 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))


Sur cette page du site, vous pouvez voir la vidéo en ligne converts the given value to a Boolean value ( True or False ). | python bool function| python course durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur thepycode 08 décembre 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 377 fois et il a aimé 50 téléspectateurs. Bon visionnage!