Hi, I am trying to write a programme to count how many times a random point lies within the positive sector of a circle. So far I can display if the point lies inside the area but I need something to allow me to count the total number of items that lie inside the area. My programme is:>>> import random>>> for i in range(10): x = random.random() y = random.random() count = 0 if x*x + y*y < 1: count = count + 1 print count
and I get a list down the screen like11111 depending on how many times a random point lies in the area. I am meant to do this with 10000 points so I can't simply count the 1's up like I can with 10. I have been looking on the internet but cant find anything that works yet. Thanks for your timeSteve Clarke
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor