Python Program to Remove the Duplicate and Check if an Element is in the List or Not || List || Python

In this we are going to see a basic program to Remove the Duplicate and Check if an Element is in the List or Not in Python Programming Language.

list1 = [1, 2, 3, 4, 5, 6, 7, 8, 5, 1, 7, 1]
print("List : ", list1)
print("---------------------------------------------------------------")
list1 = list(set(list1))
print("List After Removing Duplicates : ", list1)
print("Enter An Element To Check Whether It Is Present In List Or Not: ")
element = int(input())
if element in list1:
    print("Element Is Present In List")
else:
    print("Element Is Not Present In List")

# Coded By DHIRAJ SHELKE

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post