Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 654 Bytes

introduction.md

File metadata and controls

25 lines (18 loc) · 654 Bytes

Introduction

Python represents true and false values with the bool type, which is a subtype of int. There are only two values under that type: True and False. These values can be bound to a variable:

>>> true_variable = True
>>> false_variable = False

We can evaluate Boolean expressions using the and, or, and not operators.

>>> true_variable = True and True
>>> false_variable = True and False

>>> true_variable = False or True
>>> false_variable = False or False

>>> true_variable = not False
>>> false_variable = not True