Home » Python

math.pi constant with example in Python

Python math.pi constant: Here, we are going to learn about the math.pi constant of math module with example in Python.
Submitted by IncludeHelp, on April 19, 2019

Python math.pi constant

math.pi constant is a predefined constant, which is defined in math module, it returns the value of "PI" (π), the value of the math.pi is 3.141592653589793

Syntax of math.pi constant:

    math.pi

Return value: float – that is the value of mathematical constant "PI".

Example:

    Input:
    print(math.pi)

    Output:
    3.141592653589793

Python code to demonstrate example of math.pi constant

# python code to demonstrate example of 
# math.pi constant

# importing math module
import math 

# printing value of PI
print("value of pi = ", math.pi)

Output

value of pi =  3.141592653589793

Reference: Python math library






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.