May-01-2020, 10:47 AM
(May-01-2020, 10:45 AM)glennford49 Wrote:(May-01-2020, 10:34 AM)pyzyx3qwerty Wrote: If you want to print the same element in both lists, you can do:it returns nothing since list2 has no same item from list1 it has only 3 same elements that which i want to be printed
for i in list1 : if i in list2 : #your code
I know, as i misread your thread as print the elements, not print the number of elements
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs