Google News
logo
Python Program to Create scientific numbers with an "e" to indicate the power of 10
In the following example of Python program that demonstrates how to create scientific numbers with an "e" to indicate the power of 10 :
Program :
# Creating scientific numbers
num1 = 2e3   # 2 x 10^3
num2 = 1.5e-2   # 1.5 x 10^-2
num3 = -6.67e-11   # -6.67 x 10^-11

# Outputting the scientific numbers
print(num1)
print(num2)
print(num3)
Output :
2000.0
0.015
-6.67e-11
In the above program, we create three scientific numbers using the "e" notation to indicate the power of 10. The first number, `num1`, is equal to `2 x 10^3`, the second number, `num2`, is equal to `1.5 x 10^-2`, and the third number, `num3`, is equal to `-6.67 x 10^-11`.

We then use the `print` function to output the values of the scientific numbers to the console.

You can perform various arithmetic operations on scientific numbers in Python, such as addition, subtraction, multiplication, and division. Just like with floating-point numbers, you may encounter issues with precision or rounding errors in certain situations.