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 To Check student is Pass or Fail In Exam

Exploring Complex Numbers in Python: A Practical Guide

Write A Program In Python To Create A dictionary Of Hindi/Odia Words With Values as Their English Meaning.