Data types

Cards (12)

  • There are four basic or primitive data types, from which all others can be created. These are integers, real numbers/floats, Boolean, and char.
  • An integer is a whole number, which can be positive, negative, or zero.
  • Real is also referred to as float. Real numbers include numbers with decimal places. A real number can be positive, negative, or zero.
  • The Boolean data type is based on logic and can have one of only two values, True or False.
  • Char refers to a single character. The character can be any letter, digit, or symbol.
  • A null value is used to indicate ‘nothing’; the lack of any value, of any type of data.
  • The string data type refers to text. A string is a collection of characters and includes spaces, punctuation, numeric digits and any other symbols such as $, &, £, etc. Strings can also contain numeric digits but these will be handled as text characters, not numbers.
  • pointer is a built-in data type in some low-level languages. It will hold the address of a value or object located in computer memory.
  • Date/time is a data type used to store a calendar date/time, typically stored as an integer.
  • Records are a structure which  can store different data types, but all about the thing. E.g. a student record may contain ID (integer), name (string) and class (string). 
  • An array is a collection of elements of the same data type. Each element has its own index number starting from zero.
  • Python uses lists instead of arrays. These are very flexible as they can store different data types, unlike most other languages