If I have a list like this (Notice that it skips one after 5
, 12
, 19
, 26
.. etc. So 6
, 13
, 20
, 27
are all missing) :
lst1 = [0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61]
And I have a list like this (this represents which skips)
lst2 = [0,2] # this means the 0'st skip and 2nd skip which is 13)
And combining the lst1
and lst2
,
I want to make a new lst3
that has [0, 1, 2, 3, 4, 5, 14, 15, 16, 17, 18, 19]
I don't know if my explanation made sense, but I basically want to use values from two lists and make a new list. This is what I've tried:
lst1 = [0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61]
def colorChecker(color):
for c in color:
return 6 + 7 * color
lst3 = [ p for p in lst1 if p < colorChecker([0,2])]
This only seems to work for colorChecker[0]
, not colorChecker[1]
.