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
147 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
143,180
12
188
271
asked Feb 18 '20 at 14:25
Faraz Khan Yz
43
6
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