7/18


#1

My code is:

n = 'Hello'
def string_function(s):
s = 'world'
return n + s
print string_function(n)

I get the error message:

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

What can I do to make my code work? There is no reference to "Waynesworld" in the question, so I'm not sure what to do.
Thank you for any help you can offer.

Edit:
Thank you for the help! Here is the code I used to complete the task for anyone else that is stuck.

n = "Hello"
def string_function(s):
return s + 'world'
print string_function(n)


#2

The same thing happend with me, so i tried changing n="Hello" for n= "Waynes".
Then error comes back Oops, try again. string_function('Hello') returned 'Waynesworld' instead of 'Helloworld'
???


#3

I wrote:
n = "Hello"

Your function here!

def string_function(s):
return s+'world'
print string_function(n)

The "return" in indented...don't know how to do that in this reply.


#4

When you def the function and add the argument s.

You have to set s to equal what you want to print out.

so s = s + blahblahblah


#5

So I got the same weird response and so I adjusted my syntax. I got this as a correct answer, but I have no idea if it should be correct or not due to the weird Wayne's World response.

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


#6

The same thing happened to me, so I reloaded the page and rewrote the code and it worked just fine. Try that.


#7

Change function argument to (n)


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


    print string_function(n)