Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44628 > unrolled thread

Re: help..

Started byleonardo <tampucciolina@libero.it>
First post2013-05-02 16:20 +0200
Last post2013-05-02 16:20 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: help.. leonardo <tampucciolina@libero.it> - 2013-05-02 16:20 +0200

#44628 — Re: help..

Fromleonardo <tampucciolina@libero.it>
Date2013-05-02 16:20 +0200
SubjectRe: help..
Message-ID<mailman.1240.1367504631.3114.python-list@python.org>
on codecademy there is an interactive box where you type your code, it is a kind of exercise program to practice. but i don't understand what is wrong. this is the website address of that if you want to give a look:

http://www.codecademy.com/courses/python-beginner-P5YtY/1/3?curriculum_id=4f89dab3d788890003000096




Il giorno 02/mag/2013, alle ore 16:06, Chris Angelico <rosuav@gmail.com> ha scritto:

> On Thu, May 2, 2013 at 11:56 PM, leonardo selmi <l.selmi@icloud.com> wrote:
>> so i wrote the following code:
>> def rental_car_cost(days):
>>        cost = 40*days
>>        if days >= 7:
>>            return cost - 50
>>        elif days >= 3 and days < 7:
>>            return cost - 20
>>        else:
>>            return cost
>> 
>> but it seems not to be right cause the computer answers: Oops, try again!
>> Did you create a function called rental_car_cost?
> 
> That code looks fine to me (though I'd drop the "and days < 7" as it's
> redundant); but the error you're getting isn't a Python exception.
> What's giving that error? You may need to check the framing of your
> code. How does codecademy (which I'm not familiar with) locate your
> function?
> 
> ChrisA
> -- 
> http://mail.python.org/mailman/listinfo/python-list

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web