7/18 Lists and Functions


#1

Hey guys, I am very new at this stuff, so I would appreciate so much if someone could bring me some help. I got stuck in this exercise: 7/18 Lists and Functions. I was able to answer it, but yet is not clear for me in which moment the system identifies that the variable S has to take the value of the variable N.

I wrote this:

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

print string_function(n)

Can somebody explain to me how the system substitutes the value of "S" and take the one that is contained in "N"?


#2

Consider a function call like this:

add(5, 2)

What do you expect as a result from that?
Why would the function know to do that?

-

Make sure to mark any code in your post as pre-formatted text, if you look at your post you'll find that your code there is not intact, it will not run, it is different from what you meant to post.


#3

I made some changes, it might be clearer now.