Mar-24-2022, 10:09 PM
(Mar-24-2022, 09:32 PM)Mark17 Wrote: I have three (a, b, c) being unpacked to three (xp, yp, m).
But you don't have 3 elements in a,b,c, you have a total of 12. You can't put them into 3 variables with a single assignment. You could do that if you loop over them and change it each time.
Is this what you intend?
a = ['1-6-2017', '1-13-2017', '1-20-2017', '1-27-2017'] b = [265, -10, 130, 330] c = ['d', '', 'd', ''] for xp, yp, m in zip(a, b, c): print(f"This time through the loop {xp=}, {yp=}, {m=}")
Output:This time through the loop xp='1-6-2017', yp=265, m='d'
This time through the loop xp='1-13-2017', yp=-10, m=''
This time through the loop xp='1-20-2017', yp=130, m='d'
This time through the loop xp='1-27-2017', yp=330, m=''