Strings in functionS


When I run the code, the console prints "Helloworld" as it should. But then it gives my an error that says "Oops, try again. string_function('Waynes') returned 'Helloworld' instead of 'Waynesworld'."

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

print string_function(n)


Think about why it would use Wayne instead of Hello and then look at your code and see if you're doing that

Your function as described in the instructions is supposed to concatenate the argument and "world", and return the result. If your function ignores the argument given to it, then it will not be able to do so.


Thank you! I got it! Now it passed.

It concatenate the variable n instead of the argument s.

Thanks againg!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.