I have this code in Python where i have to print the non repetitive alphabets in below list. like the output should be 'fl'
since 'fl'
is common in all the three string:
x=["flower","flow","flight"]
print([i for i in zip(*x)])
It prints the following output:
[('f', 'f', 'f'), ('l', 'l', 'l'), ('o', 'o', 'i'), ('w', 'w', 'g')]
How does it work? I know that zip(*)
is used to unzip a list. is it taking "flower,"flow" and "flight" as separate list items.