python - Strip list to compare with another list -
this question has answer here:
- testing if list contains list python 11 answers
i try import list in python. however, customize code in such way, list this:
['a', 'b', 'c']
instead of this:
[["['a','b','c']"]]
the reason have compare if list in list , won't succeed when list not formatted well. rest of code looks this:
def check(a1, a2): lista = [] listb = [] lista.append(a1) listb.append(a2) if lista in listb: print true else: print false
i'm not sure if understand correctly. looking this?
a = ['some', 'list', 'items'] print ', '.join(a)
this print
some, list, items
but won't solve you're trying do. comparing 2 lists shouldn't involve print @ all.
Comments
Post a Comment