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 189 views
1 answer 286 views
2 answers 449 views
449 views asked Jun 5, 2016 by avibootz
2 answers 1,277 views
1 answer 235 views
235 views asked Jul 21, 2021 by avibootz
3 answers 355 views
1 answer 179 views
179 views asked Nov 29, 2022 by avibootz
...