Write a program to find out whether a given post is talking about "harry" or not using Python?

write a program to find out whether a given post is talking about harry or not?

Code:

post = input("Enter a post: ")
if 'harry' in post.lower():
    print("Yes! the post contains the name Harry.")
else:
    print("No! the post does not contain the name Harry")

Output:

Enter a post: harry
Yes! the post contains the name Harry.
Enter a post: HARRY
Yes! the post contains the name Harry.
Enter a post: Harry
Yes! the post contains the name Harry.




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