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
Post a Comment