Python Programming

Department of Computing, Imperial College London

home

Python for C++ Programmers

  • Chapter 1: Introduction
  • Chapter 2: Basic data types
    • [2.1] Basic built-in data types
    • [2.2] Numbers
    • [2.3] Booleans
    • [2.4] Strings
    • [2.5] Multiline strings
  • Chapter 3: Variables and operators
  • Chapter 4: Sequence types
  • Chapter 5: Sets and dictionaries
  • Chapter 6: Control flow
  • Chapter 7: Functions
  • Chapter 8: Object-oriented programming
  • Chapter 9: Modules
  • Chapter 10: Files

Chapter 2: Basic data types

Booleans

face Josiah Wang

Booleans (bool) can be either True or False.

Note that the literals are Capitalised and not lowercase as in C++.

Try these out!

>>> type(True)
>>> type(False)
Previous Next

Page designed by Josiah Wang

Department of Computing | Imperial College London