[Tutor] Why do I not get the same results for these two functions when I pass 7 as an argument?

Dave Angel davea at davea.name
Sat May 4 02:34:28 CEST 2013


On 05/03/2013 12:51 PM, Nonso Ibenegbu wrote:
> Great! Many thanks for the help offered. The background of the problem is
> that if I book a certain service for 1 or 2 days I pay $40 per day, if I
> book 3,  4, 5 or 6 days I get $20 off but if I book above 7 days I get $50
> off.
>
> The first function does the job!

By accident only.
The elif on the first one doesn't compare days to 7 at all.  So it's 
simply equivalent to:

     elif days >= 3:

If you can't understand that, then comparing the two functions is useless.


-- 
DaveA


More information about the Tutor mailing list