Re: [Tutor] Pi approximation

2018-03-28 Thread boB Stepp
I see I wrote the below a little too quickly! Don't forget to take the reciprocal when printing. You might want to modify my naming of variables to reflect this. And return the reciprocal, which actually gives the pi approximation in the function form. On Wed, Mar 28, 2018 at 9:08 PM, boB Stepp

Re: [Tutor] Pi approximation

2018-03-28 Thread boB Stepp
On Wed, Mar 28, 2018 at 2:09 PM, Roger Lea Scherer wrote: > In one of my lessons I am asked to compare approximations for pi. I got > everything to work properly and my attempt is successful and matches > Python's approximation up to 15 digits to the right of the decimal, but I > suspect I can do

Re: [Tutor] Pi xels

2013-05-09 Thread Alan Gauld
On 09/05/13 15:36, Stafford Baines wrote: Is there a way of controlling pixels on a graphics screen? > I want to be able to draw lines and curves. > Is this possible with with Python? Yes, there are lots of options. Any GUI library will have a canvas object upon which you can draw primitive g

Re: [Tutor] Pi xels

2013-05-09 Thread Steven D'Aprano
On 10/05/13 00:36, Stafford Baines wrote: Is there a way of controlling pixels on a graphics screen? I want to be able to draw lines and curves. Is this possible with with Python? There are many powerful libraries for working with graphics in Python, but they often have a very steep learning

Re: [Tutor] Pi xels

2013-05-09 Thread Hugo Arts
On Thu, May 9, 2013 at 4:36 PM, Stafford Baines wrote: > Is there a way of controlling pixels on a graphics screen? I want to be > able to draw lines and curves. Is this possible with with Python? > > Stafford > There are various libraries available for drawing. Check these links, they might be u

Re: [Tutor] PI

2011-05-26 Thread delegbede
Do import math first I.e type import math You could also do from math import pi Provided pi is the only function u need in the math module. from math import * This imports every function of the math module. HTH Sent from my BlackBerry wireless device from MTN -Original Message- From: David

Re: [Tutor] PI

2011-05-25 Thread memilanuk
On 05/25/2011 09:21 PM, David Merrick wrote: How do I can access to the math module to use PI? area = math.pi * pow(3,2) Traceback (most recent call last): File "", line 1, in area = math.i * pow(3,2) NameError: name 'math' is not defined try 'import math' first... __