7 - 12: Strings in functions


#1



https://www.codecademy.com/en/courses/python-beginner-nzzVa/1/3?curriculum_id=4f89dab3d788890003000096


So my code throws an error that says:
Oops, try again. string_function('Hello') returned u'world' instead of 'Helloworld'


Any help would be appreciated.


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


print string_function(n)


#2

Wouldn't it be,

s + " world"

?


#3

The instructions say not to add a space before "world", so I think its something else.


#4

Then ignore the space, but replace raw_input() with s.


#5

That worked like a charm! Thanks!


#6

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