[Solved] Why pass a variable to a function in Python? [closed]
Doing it the first way severely hampers the re-usability of your function. Simple Example: What if I wanted to see the outcome from of your function when y=3 when x is any of the numbers in [2, 4, 6]? With the first example, you’d need: def f(): return x + y results=[] y = 3 … Read more