[Type A] Python Revision Tour-1 – Chapter 1

|
Table of Contents

6. How are floating constants represented in Python?

Floating-point constants in Python can be represented using decimal notation or scientific notation. For example:

# Decimal notation
f1 = 3.14
# Scientific notation
f2 = 2.5e2  # equivalent to 2.5 * 10^2

Leave a Reply

Your email address will not be published. Required fields are marked *