Advertisement
Felanpro

bool()

Jul 31st, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. #bool([object]) is a built-in function that is avaible at any time.
  2. #If x = True, and bool(x) will print True. Else if x = false print false
  3. #Remember that 1 = True and 0 = False
  4.  
  5. flag1 = True
  6. flag2 = 1
  7. flag3 = 0
  8.  
  9. x = bool(flag1)
  10. y = bool(flag2)
  11. z = bool(flag3)
  12.  
  13. print(x, y ,z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement