0
Spam detector
What i input all are being shown that as a spam!!! Help me slove it https://code.sololearn.com/cxtXmWk5cx8G/?ref=app
8 Réponses
+ 3
I think the condition you wrote in the if statement should be:
if text in ("click to download", "click to make money", " click to watch", "watch this", " click to log in")
+ 1
Pks I used lower to convert the entered text into lowercase. And no, if u input "watch this" or any of the other phrases in the tuple, it shows it's a spam
0
shreya did u try? Let me try and i will get back to u
0
shreya it didnt work. I know i have to use elif but i want to know whats wrong with this one
0
It's working here
https://code.sololearn.com/c97UPgqc4vy2/?ref=app
0
shreya what about lower(). Why did u use it? and now whatever i input in your one, shown that, its not a spam😃😃😃
0
shreya i made a mistake actually. When input prompt came i put a spece before write.thats why its made wrong answer.thanks for helping
0
txt = "click to downloa buddy"
l= ["click to download", "click to make money", " click to watch", "watch this", " click to log in"]
if any(i in txt for i in l):
print("Spam")
else:
print("Ok")