Detect Spam Comments Using Python

 A spam Comment Define As Text Conating Following Keywords "make a lot of money","buynow", "Subscribe this", "click this" write A program to detect spam is Using Python Program

Code:

comment = input("Enter the comment : ")

if ("make a lot of money"in comment) :
    spam = True
elif ("buy now" in comment) :
    spam = True
elif ("subscribe this" in comment) :
    spam = True
elif ("click this" in comment) :
    spam = True
else :
    spam = False

if (spam) :
    print("This Is a Spam Comment")
else :
    print("This is not a Spam Comment")

Output:

Enter the comment : buy now
This Is a Spam Comment

Comments

Popular posts from this blog

Write A Python Program, Create n Empty Dictionary Allow 4 Friends To, Enter Their Favorite Programming Language As values and User Keys as their Name Assume That The Names Are Unique.

Write Python Program To Store Seven Fruits Name In a List Enter By The User