65.8k views
5 votes
Ask the user to enter a name. If there is an ‘a’ in the name, print the message saying ‘The name contains at least one ‘a.’ If there is no ‘a’ then print “The name does not contain the letter a.”

1 Answer

2 votes

name = input("Enter your name: ")

if "a" in name:

print("There's at least one 'a'")

else:

print("The name does not contain the letter a.")

I wrote my code in python 3.8. I hope this helps!

User Pandelis
by
3.7k points