(Nov-04-2017, 08:03 PM)atux_null Wrote: the logic is to have in the format:Well, I mean:mylist=[___for i in range(1,5)]where___
needs to get substituted from the necessary part of the code to make the list have[10,0,10,10]
>>> [0 if i == 2 else 10 for i in range(1,5)] [10, 0, 10, 10] >>>Seems to get what you want, but I've got to say that is a really stupid problem.