What does integer mean?
A whole number, positive, negative or zero, with no fractional part: 3, -12, 0. Python calls the type int.
In a lesson
20 / 5printed4.0, not4:/always gives a float, even when the answer is whole.//gives an integer.roundtidies a long float: the second argument is how many decimal places to keep.
Learn it
- Taught in F1.9 Arithmetic operators Programming basics, GCSE
Used in
- F1.8 Data types and casting
- F1.10 Project: ask and drive
- F3.2 Character codes and conversion
- F3.3 Lists: one-dimensional arrays
- F3.6 Records
- F5.1 What an algorithm is
- F5.5 Linear search
- F5.6 Binary search
- F6.1 Defensive design and validation
- F6.3 Testing and test data
and 93 more lessons.
Do the lesson in the simulator