7.Strings in Functions


#1



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


#2

"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?


#3

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


#4

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


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


print string_function(n)

#6

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