How to get the constant PI value in Python

2 Answers

0 votes
import math

print("%.2f" % math.pi)


'''
run:
 
3.14

'''

 



answered Mar 7, 2018 by avibootz
0 votes
import math

print(math.pi)


'''
run:

3.141592653589793

'''

 



answered Sep 14, 2018 by avibootz

Related questions

1 answer 197 views
1 answer 294 views
2 answers 458 views
458 views asked Jun 5, 2016 by avibootz
2 answers 1,284 views
1 answer 240 views
240 views asked Jul 21, 2021 by avibootz
3 answers 363 views
1 answer 189 views
189 views asked Nov 29, 2022 by avibootz
...