samedi 16 mai 2020

Check non-equality between tuples [duplicate]

Imagine I have this tuples.

T1 = (2, 1)
T2 = (2, 2)

So I want to know if each element for T1 is the same in T2. Like this

'This is false' if T1[0] != T2[0] or T1[1] != T2[1] else 'is True!'

is there any cool way to check this without going through each element of each tuple?

Aucun commentaire:

Enregistrer un commentaire