Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Combine two lists without duplicate values

$
0
0
list1 = ["palani", "samy","be"]list2 = ["palani", "samys","be"]def find_common(list1,list2):    for x in list1:      for y in list2:        if x == y :          list2.remove(x)     print" unique string 1:",list1    print" unique string 2:",list2    print" combained string 2:",list1.append(list2)find_common(list1,list2)

enter image description here

Why am I getting None?


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>