Overview - Datatypes
As previously shown in the docs page Variables, every variable always has a type that defines what values it can store. This also means that you often can not mix variables of different data types together, as they fundamentally represent different things.
What is a datatype?
A data type defines the type of value, which can be stored in a variable or constant.
A variable with the datatype num
, for example, can only contain numbers. A variable
with an str
datatype can only contain text, symbols or numbers, but saves them as text.
This makes them for example impossible to use for calculations and as such using them in arithmetic
expression is invalid.
Important
Data types can not be mixed together and must be converted before being used with another type.
✓ VALID CODE
X INVALID CODE