Re: Simple integer comparison problem

2007-04-14 Thread Anton Vredegoor
Bart Willems wrote: > I have a feeling that there's a Python-solution that is shorter yet > better readable, I just can't figure it out yet... Shorter (and faster for big lists): Yes. More readable: I don't know, I guess that depends on ones familiarity with the procedure. import bisect def g

Re: Simple integer comparison problem

2007-04-14 Thread Bart Willems
> if points > 89 and points <= 100: > return "A" > elif points > 89 and points <= 89: > return "B" > elif points > 69 and points <= 79: > return "C" > elif points > 59 and points <= 69: > return "D" > else: > return "F" The previous poste

Re: Simple integer comparison problem

2007-04-14 Thread tom
Thanks for help! -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple integer comparison problem

2007-04-14 Thread Dan Bishop
On Apr 14, 10:19 am, [EMAIL PROTECTED] wrote: > Hi! > I ran in problem with simple exercise. I'm trying to get program to > return grade when given points but no matter what, I always get F. > > def grader(): > print "Insert points: " > points = raw_input('> ') > int(points) > >

Re: Simple integer comparison problem

2007-04-14 Thread Jakub Stolarski
On Apr 14, 5:19 pm, [EMAIL PROTECTED] wrote: > Hi! > I ran in problem with simple exercise. I'm trying to get program to > return grade when given points but no matter what, I always get F. > > def grader(): > print "Insert points: " > points = raw_input('> ') > int(points) > >

Simple integer comparison problem

2007-04-14 Thread tom
Hi! I ran in problem with simple exercise. I'm trying to get program to return grade when given points but no matter what, I always get F. def grader(): print "Insert points: " points = raw_input('> ') int(points) if points > 89 and points <= 100: return "A" eli