🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X
Questions




































Write a python program to search for a given element in an list.

Last Updated : 27 Jul 2026 Jul 23

Solution:

# Define the list and the target element
languages = ["Python", "Java", "C++", "JavaScript", "Go"]
target = "C++"

# Check membership using the 'in' operator
if target in languages:
    print(f"'{target}' was found in the list!")
else:
    print(f"'{target}' was not found.")
Report an error
Latest Updates