Nov-19-2019, 07:42 PM
(This post was last modified: Nov-19-2019, 07:43 PM by allusernametaken.)
(Nov-19-2019, 04:16 PM)stullis Wrote: Once it reaches the end last index of the tuple created by *args, it terminates without running the loop body. In effect, the for loop would perform 2 * 5 * 6.Would you please guide me with more examples or a link for supplementary readings to understand what you're saying?
My understanding was that the for loop begins then,
z = 1 and 2, 5 & 6 are num and
1* = 2
1* = 5
1* = 6
...wait, I'm even more confused. I don't think I understood it at all before.
(Nov-19-2019, 04:19 PM)Gribouillis Wrote: Here is a printing example with the *args argument
>>> L = [2, 5, 6] >>> print(*L) 2 5 6
Oh, nice. you can unpack it as well. Thank you.