Jun-28-2020, 12:26 AM
Hello all,
I would like to reduce the following python code.
I have one list:
And the following statement s are all true
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.
I would like to reduce the following python code.
I have one list:
1 |
a = [one, two, three, four] |
1 2 3 4 5 6 7 8 |
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 ]) |