r/pythonhelp • u/janetliy2001 • Oct 07 '21
HOMEWORK Easy: just started learning python. Can’t figure out how to assign the result to a variable. Don’t know what I did wrong here. Thank you to anyone willing to explain.
2
Upvotes
r/pythonhelp • u/janetliy2001 • Oct 07 '21
2
u/[deleted] Oct 07 '21
In order to call a function, just treat it as if function_name(args) will be replaced with whatever that function returns. In other words, just like you could do variable = 1, or string = "foo", you can do result = function(argument).
When calling functions, you don't need to specify what argument is equal to do what, you can just do display_name('Janet', 'Liu'). Inside the function, firstname is whatever the first argument is, and lastname is whatever the second one is.