0
ここに私がしようとしていることがあります。forループの対象リストとして未知数の参照のリストを展開します
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
私は私がやっている何の意図が明確でない場合は知っているか、私はどのような方法でそれより良い単語可能であれば聞かせて下さい。
ありがとうございます。