I have some pretty basic questions about the different types of numbers in python (and other languages).
What is the difference between an integer and a floating point number? I'd appreciate a detailed answer explaining some of the fundamentals.

Recommended Answers

All 2 Replies

You can think of integer numbers as decimals:
1, 300, 7000

Floating point numbers are a sequence of decimals that contain a decimal point, an exponent part, or followed by one or more digits or both:
0, 0.0, 1.0, 1e0

If you are familiar with C, you can think of a floating point number as a double.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.