Skip to main content

2.7) Basic Programming Concepts


Python, like other programming languages, is based onĀ the following basic building blocks:

  • Variables are used to access values of objects
  • Objects can be of several types such as numbers and text strings
  • You can organise your data in lists and other data structures
  • Tests allow you to perform tasks depending on a specific condition
  • Loops are used to repeat a command or set of commands a number of times
  • Comments can be inserted in your program to document your code

These building blocks all have to adhere rigidly to some rules, a syntax, specific to each language. Just like punctuation is important in our languages, leading spaces, brackets and other symbols are used to arrange loops, tests and comments in computing. If you make a mistake, like missing out a bracket, your program will give you an error.