python - Strip list to compare with another list -


this question has answer here:

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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -