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 191 views
1 answer 288 views
2 answers 452 views
452 views asked Jun 5, 2016 by avibootz
2 answers 1,279 views
1 answer 237 views
237 views asked Jul 21, 2021 by avibootz
3 answers 357 views
1 answer 183 views
183 views asked Nov 29, 2022 by avibootz
...