Python's built-in numeric types
Question:
Which of the following numeric types are built into Python’s syntax?
- Fractions
- Complex numbers
- Integers
- Formatted strings
- Floating-point numbers
Answer:
B, C, E - are the correct answers. If a numeric type is built into Python, that means you can use it right away, without importing any modules. The three built-in numeric types are int, float, and complex
A - is incorrect. Fractions are a numeric type, but they’re not built into Python. Instead, you can access them through a standard-library module. The same goes for decimals
D - is incorrect. Formatted strings, commonly known as f-strings, can be very helpful when working with numbers, but they’re not a numeric type