Oct-23-2019, 07:44 AM
(This post was last modified: Oct-23-2019, 08:04 AM by Sandeep2000.)
(Oct-23-2019, 07:27 AM)woooee Wrote: If you want items in both lists, use set union https://www.programiz.com/python-programming/set#unionThank you for suggesting better ways. I know there are many ways to do this simple task.
But can i expect that output from code above? Can you see if there is something wrong with the code itself.
Sorry i misplaced plist and qlist.
phrase="don't panic" plist=list(phrase) str1="on tap" qlist=list(str1) for item in plist: if item not in qlist: plist.remove(item) print(plist)