How can I concatenate an argument and a string?


#1

Question

How can I concatenate an argument and a string?

Answer

Arguments given to a function can be used like any other variable. Recall that we can concatenate a string and a variable like this: my_concatenated_string = "HOLY " + cow_string_var.
So all we need to do for this function is return parameter_name + "the string it wants us to concatenate with it!".


FAQ: Learn Python - Lists and Functions - More than one argument FAQ: Learn Python - Lists and Functions - Strings in functions