Jun-28-2020, 12:26 AM
Hello all,
I would like to reduce the following python code.
I have one list:
I would like to reduce the following python code.
I have one list:
a=[one, two, three, four]And the following statement s are all true
if a[0] in b: print(a[1]) if a[1] in b: print(a[2]) if a[2] in b: print(a[3]) if a[3] in b: print(a[0])How can I reduce this to two lines of code and still to run in sequence? It will permit list a to be of "n" length and I will not have to add them individually.