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

Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class

Ask a doubt
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 13 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.