Data Types in Python
Each object has a specific class that determines where the object can be used.
Classes are objects.
›int‹
The object of an integer numeral has the class ›int‹ (regardless of whether it is a decimal or hexadecimal numeral).
This class can still display a great many digits accurately.
- Input of an expression and output of a text representation of its value
9_223_372_036_854_775_808
9223372036854775808
- Input of an expression and output of a text representation of its value
999_999_999_999_999_999_999_999_999_999_999_999_999
999999999999999999999999999999999999999
›float‹
If a numerical is written with a dot ».«, it's value is an object of type ›float‹.
Values of this type can be imprecise or incorrect in the lower positions.
- Input of an expression and output of a text representation of its value
1.999_999_999_999_999_9
2.0
- Input of expressions and output of a text representation of their values
9_007_199_254_740_991.
9007199254740991.0
9_007_199_254_740_992.
9007199254740992.0
9_007_199_254_740_993.
9007199254740992.0
»E« within a numeral means „times ten to the power of “ and also determines the type as ›float‹.
- Input of an expression and output of a text representation of its value
2E3
2000.0
›str‹
An object that is the value of a string literal has the class ›str‹.