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