Question
Does return print values to the screen?
Answer
No, return
simply gives a value to wherever it was called in the program. In this exercise, we see that our function list_function()
just takes a parameter x
and returns it. print
looks for a value after it to display it to the screen, and the value it gets is the value return
ed by the list_function()
when we pass it a list, n
!
Anytime you want something to be print
ed, you need to use the print
function.