7.Strings in Functions


I follow instructions, there is no word about "Waynesworld". What am I doing wrong ?


"Waynes" is one of the test cases of the exercise, lets add it:

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

# function calls with arguments
print string_function(n)
print string_function("Waynes")

See how i added a second function call with argument Waynes? This should work correctly, but it doesn't

how could we make our function work correctly? Something to do with the function parameter maybe?


There is no reason why using "Waynes." I tried your solution and it doesn't work.


yes there is, its one of the test cases by the exercise to verify your code works correctly.

This function isn't designed to only work for one string and can't be imported.

make sense, its because its not the solution. It only shows the problem with the code.

I am helping people, not spoon-feeding them the solution

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

print string_function(n)


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