Post

Python Developer
Python Developer@PythonDvz·
Comment below the output! 😃👇
Python Developer tweet media
English
14
11
118
9.4K
Coding Computing Coach
Coding Computing Coach@CodingComputing·
@Python_Dv Answer: A Solution: Here the main trick is that... `return` takes you out of the function. Breaks out of every loop, conditional, whatever. Straight back to where the function was called from. Here func is called in the argument to print. Inside func there is a loop over +
English
0
0
0
363
Coding Computing Coach
Coding Computing Coach@CodingComputing·
@Python_Dv `elements` which is [10, 20] What happens in the 1st iteration of the loop? x gets the value 10. And then we return x. That's it. We saw return. End of story for the function. The loop is terminated, the function is terminated. `return` directly takes 10 to print +
English
0
0
0
52
Paylaş