[Tutor] Codeacademy Problem

Dave Angel davea at davea.name
Mon Apr 29 20:32:42 CEST 2013


On 04/29/2013 12:31 PM, Joseph Parkton wrote:
> Yupp I totally agree on the errors. I finally had to change the
>
>      def hotel_cost(nights):
>          nights = nights * 140
>          return nights
>
> to
>
>      def hotel_cost(nights):
>      return hotel_cost(nights) * 140
>
> for it to work. Strange errors but decent exercises for beginners.
>

That certainly doesn't work.  Either you get an indentation error, or 
once you fix that, you get infinite recursion.

Have you ever tried running this code on your own machine, or are you 
stuck only with the strange error messages of codeacademy?

-- 
DaveA


More information about the Tutor mailing list