+ 1
How can I fix this code to identify my input word with the words either in the oldMe list or the new me list and print out ?
7 Réponses
+ 2
JayVEL J-137
What you want to do? What output do you expect?
https://code.sololearn.com/cYNj1zW4nZAp/?ref=app
+ 2
🅰🅹 🅐🅝🅐🅝🅣 thanks so much
+ 1
JayVEL J-137
What you want to do here? You have done lots of mistakes
1 - newMe is a list. You cannot compare string with a list like that.
2 - why you used break inside while loop because after 1st iteration process will stop there.
3 - mood is string then how you can increment 1 in mood.
+ 1
🅰🅹 🅐🅝🅐🅝🅣 how would you do it?
+ 1
Either the print of the if Statement or the print of else Statement, since the word in the input should either be on both lists
+ 1
🅰🅹 🅐🅝🅐🅝🅣 This code of yours is amazing, I prefer yours more than mine
+ 1
JayVEL J-137
You can check String present in both lists like this also
if mood in newMe or mood in oldMe:
print (count)
Check code again