Hier ist, was ich versuche zu tun.Liste der unbekannten Anzahl von Referenzen als Zielliste in for loop entpacken
from itertools import product
li = []
# Append arbitrary/unknown number of integers to li
ranges = [range(1, n) for n in li]
# Question 1: How to create a list of *references* whose length is that of li (or ranges)
# Is this the right way?
target_list = [None, ] * len(ranges)
# Question 2: Unpack this target_list of references in a for-loop, How to?
# Something like so (of course this does not work, just trying to convey intent)
for *target_list in product(ranges):
# Access specific elements of target_list
Bitte lassen Sie mich wissen, ob es die Absicht von dem, was ich tue, nicht klar ist, oder wenn ich kann Wort, um es besser in keiner Weise.
Vielen Dank für das Hören.