Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
How to check both list has same values and same length in python
Asked
Feb 18 '20 at 14:25
Active
Feb 18 '20 at 14:44
Viewed
98 times
0
for Example:
a = ['yes','no','both'] b = ['no','both','yes']
it should return True.
python
python-3.x
list
comparison
unordered
edited Feb 18 '20 at 14:44
ShadowRanger
124,179
11
158
228
asked Feb 18 '20 at 14:25
Faraz Khan Yz
43
5
if you know there aren't any duplicates, then `set(a) == set(b)` should do the trick
–
Adam.Er8
Feb 18 '20 at 14:26
Thanks, it resolved my query .
–
Faraz Khan Yz
Feb 18 '20 at 14:30
0 Answers
0