Write A Python Program Which is Find out Whether a given name is Present in a List.

 Write A Python Program Which is Find out Whether a given name is Present in a List.

Code:

names = ["Jaga", "Bibhu", "Nirakar", "Subrat", "Rama", "Rajeeb"]
name = input("Enter the name to check\n")

if name in names:
    print("Your name is present in the list")
else:
    print("Your name is not present in the list")

Output:

Enter the name to check
Rajeeb
Your name is present in the list
Enter the name to check
Hari
Your name is not present in the list


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