0
Help with challenge problem
https://code.sololearn.com/cfu6jJHUvgYC/?ref=app Can someone explain why the output came out the way it is? I thought the output would be [1] [3] since the function sets L as [] when that parameter isnât given.
2 Answers
0
Because you call it twice. And both lists the function returns are the same list. Proved by printing the id() on both function calls. So it works as it should. What are you trying to do exactly?
0
It was one of the challenge problems I got wrong and I wasnât sure about the solution. I understand it now.