Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39309
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: Python problem |
| Date | 2013-02-19 23:10 -0500 |
| Organization | > Bestiaria Support Staff < |
| References | <d8fe7094-3f11-4d18-88cc-a75dbf1b832e@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2083.1361333412.2939.python-list@python.org> (permalink) |
On Tue, 19 Feb 2013 19:01:53 -0800 (PST), ach360@gmail.com declaimed the
following in gmane.comp.python.general:
> I'm so lost. Given the formula pi=4-4/3+4/5-4/7+4/9-4/11+...... How do I print a table showing approximate value of pi by computing one term4-4/3 then two terms4-4/3+4/5, and so on.Then how many terms of the series before I get 3.14, 3.141, 3.1415, 3.14159. Please helps computer teacher literally says figure it out and doesn't help and expects a perfect program.this is in python 3 please give an answer I can understand and an example.
> Thanks :) :)
> I need this right now.
> Thanks for your time.
>
> I need this ASAP
It is homework... No one will give you an answer... Normally we'd
ask you to show use what you have tried, and we'd try to suggest where
you went wrong. I'll give you five hints...
HINT: The first term of the equation is equivalent to 4/1
HINT: The denominators are odd integers.
HINT: Each iteration is adding 4/<nextodd> to the preceding sum
HINT: Subtraction is the addition of a negative value
HINT: Each "even" term is a subtraction
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python problem ach360@gmail.com - 2013-02-19 19:01 -0800
Re: Python problem Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-19 23:10 -0500
Re: Python problem ach360@gmail.com - 2013-02-19 20:36 -0800
Re: Python problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-20 04:22 +0000
csiph-web