Error message does not apply to excercise?


Write a function called string_function that takes in a string argument (s) and then returns that argument concatenated with the word 'world'. Don't add a space before world!

Oops, try again. string_function('Waynes') returned 'Helloworld' instead of 'Waynesworld'

And when changing "Hello" to "Waynes" the message reads:
Oops, try again. string_function('Hello') returned 'Waynesworld' instead of 'Helloworld'

n = "Hello"
# Your function here!
def string_function(s):
    return n + "world"

print string_function(n)


Hi @rarchamb ,

The message does apply to the exercise. Codecademy tests your function with its own arguments, in addition to executing the code that you submit.

Codecademy tested your function by passing it "Waynes" as an argument. However, the return statement in your function ignores the function parameter, s, as it accesses the global variable, n, instead.


Well, how silly am I??
Thank you for your reply!!! it now works perfectly!!!