Help with 2/7


def hotel_cost(night):

return 140 * nights
  • "Did you create a function called hotel_cost"..?

why does it state that?

Thanks in advance for any help:)


The parameter in your function is 'night'. However you used 'nights' in your function code.


My code is:

return 140 * nights

and I am getting the same error message.


def hotel_cost(n):
return n*140


@bigdavidginola Just follow the instrucctions, I will coding for you step by step.

  1. Define a function called hotel_cost with one argument nights as input.

    def hotel_cost(nights):

  2. The (Here is your variable) hotel costs $140 per night

def hotel_cost(nights):
    hotel_cost = 140

2.1 So, the function hotel_cost should return 140 * nights.

def hotel_cost(nights):
    hotel_cost = 140
    return hotel_cost * nights

:+1: The details are very importar when you are reading the instrucctinos :eyes:


@mrugerio but I did this
def hotel_cost(nights):
return 140 * nights
and this work for me ?? why would it work different was can u explain please ??


@ozdoglord is the same. I just followed the instructions textuality


The code who is asking stay like this:
def hotel_cost(night):
return (140 * night)
print hotel_cost(5)

But, if you want to meke some more sophisticated you can do like this one:
def hotel_cost(n,d):
return (d * n)
print hotel_cost(5,140)

In that way you going to do a better instrument.


thnk u so much it works finally :slight_smile: