Python Programming

Department of Computing, Imperial College London

home

Python for C++ Programmers

  • Chapter 1: Introduction
    • [1.1] Introduction
    • [1.2] The Zen of Python
    • [1.3] Example Python program
    • [1.4] Python vs. C++ - Main function
    • [1.5] Python vs. C++ - Variable declaration
    • [1.6] Python vs. C++ - Semicolons
    • [1.7] Python vs. C++ - Braces
    • [1.8] Python vs. C++ - Comments
    • [1.9] Running Python
    • [1.10] Running Python as a script
    • [1.11] Running Python interactively
  • Chapter 2: Basic data types
  • 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 1: Introduction

Python vs. C++ - Variable declaration

face Josiah Wang

You also do not need to declare variables in Python. In Python, variables are just labels that point to object instances in memory, and are not statically bound to a specific data type. We will talk about this a bit more later.

Simple guessing game - C++ vs Python (variable declaration)

Previous Next

Page designed by Josiah Wang

Department of Computing | Imperial College London