Welcome to the wonderful world of generators!
Looking at your code, you'll notice two things. First, you're
iterating over all the numbers twice: once to calculate them, and then
another time to actually do the sum. What's worse, at any given point
in time, you're only really using fibs[-1] and fi
Hi,
Total beginner to python and am working my way through Michael Dawsons
'Absolute beginner' book. Just got stuck on the last bit of the challenges
from chapter 3. Essentially need to create a game where the user picks a
number between 1 and 100 and the computer has to guess, program should
indi
> I see. Thanks that is exactly what I was looking for. Would your
> example be an instance of an object-oriented approach,
> compartmentalizing things into functions?
That's an interesting question.
It's an example of abstraction, which is one of the pillars of object
oriented design. You're abs
On 05/08/2014 06:00 AM, Kevin Johnson
wrote:
Hi,
Total
beginner to python and am working my way through Michael
Dawsons 'Absolute beginner' book. Just got stuck on the last
bit of the challenges from chapt
On Wed, May 07, 2014 at 08:49:11PM -0700, Scott W Dunning wrote:
[...]
> > >>> greeting [len(greeting)]
> >
> > It is trying to access the character at the position "11", where the
> > string "Hello world" doesn't contain any value in the index "11" and
> > the maximum index is 10. So it throws
On 08/05/14 11:00, Kevin Johnson wrote:
user picks a number between 1 and 100 and the computer has to guess,
Hmm, usually its the other way around, the computer picks a number and
the user guesses it. Interesting twist!
The highlighted bit is where I think I'm going wrong but I just can't
t
Hello Kevin, and welcome!
My responses are below, interleaved between yours.
On Thu, May 08, 2014 at 10:00:11AM +, Kevin Johnson wrote:
> Hi,
>
> Total beginner to python and am working my way through Michael Dawsons
> 'Absolute beginner' book. Just got stuck on the last bit of the challenge
On 5/7/2014 8:39 PM, C Smith wrote:
I see. Thanks that is exactly what I was looking for. Would your
example be an instance of an object-oriented approach,
compartmentalizing things into functions?
One of the fun parts of Project Euler is using mathematical analysis and
other tricks to improve
Thank you all, babel works just fine. I also tried ccy, which isn't bad
either - except that it returns non-unicode currency letters for countries
in the Eurozone.
On Mon, May 5, 2014 at 10:10 AM, Peter Otten <__pete...@web.de> wrote:
> Sithembewena Lloyd Dube wrote:
>
> > Thanks, i was actually
Sorry, I¹m sure this has been asked before:
I¹m new to python but not so much to programming. I need to construct a
set or programs to test a forms poster that has been enhanced (it is in
php). I mostly need http get and post. This is a hands on set of tests
and does not have to be bullet proof
Hello,
: I¹m new to python but not so much to programming. I need to
: construct a set or programs to test a forms poster that has been
: enhanced (it is in php). I mostly need http get and post. This
: is a hands on set of tests and does not have to be bullet proof.
:
: What would b
gt; > > from an interactive shell:
> > >
> > > import pycountry
> > > country = pycountry.countries.get(alpha2='DE')
> > > currency = pycountry.currencies.get(numeric=country.numeric)
> > > Traceback (most recent call last):
> > > File
12 matches
Mail list logo