What are the two constants available in math module? How are they used?
Answer:
The two constants available in math module are:
- e = 2.718281...
- pi = 3.141592…
These are imported using the statements:
- from math import pi
- from math import e
Now they can be used directly in the program.
Example:
- Area = pi * r * r
- C = e**10