Quantcast
Channel: User Ciprian Tarta - Stack Overflow
Viewing all articles
Browse latest Browse all 31

Answer by Ciprian Tarta for python - extend and replace if if-statement is true

$
0
0

Have you tried using filter?

Like so:

for i in filter(lambda x: x in [y for y in result if y[:2] == x[2:]] , list_byte):    print(i)

Basically, the lambda function returns true if your tuple is found in the result meeting your condition y[:2] == x[2:]

Might need some adjustments to make it work


Viewing all articles
Browse latest Browse all 31

Trending Articles