Strings in functions



Have used various methods, but still cant find correct solution. Can someone tell directly what i am missing out

Replace this line with your code.


n = "Hello"
# function with parameter s
def string_function(s):
     print s

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

please read the comments in the code above, i am going to use those terms in my explanation.

so, when we call the function we supply an argument (n or "Waynes" for example), the argument gets passed into the function parameter s

the great thing about functions is that we can use them to a repetitive task.

so you should use s (the function parameter) to concatenate "world" an the argument supplied at function call.


thx! now i get it, i didnt thought it was that easy