My first Python code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

My first Python code

My first python program: an approximation of pi with Monte Carlo method. Is it possible to make the code shorter? https://code.sololearn.com/cTO6UKXuhOI0/?ref=app

3rd Dec 2017, 1:51 PM
S K Lurk //\●●/\\
S K Lurk //\●●/\\ - avatar
1 Answer
0
you can use a for loop to shorten it. you won't need to initialize a counter and update it.
3rd Dec 2017, 10:46 PM
Kevin Oudai
Kevin Oudai - avatar