Apr-01-2020, 12:41 PM
The elements that get displayed in list3 are '1a','1b','1c' not 'a','b','c'. Therefore, 'a','b','c','d','e','f' gets printed when you type if i not in list3. However, when you print if i not in str(list3), it looks for the elements inside the words and then prints the right answer.
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