Sunday, 23 January 2022

Write a Python program to accept n number in list and remove duplicates from a list

Slip 1 Q 1

CODE :

marks =[]
n=int(input('Enter number of elements : '))
for i in range(n):
    value=int(input())
    marks.append(value)
print(marks)
new_marks=[]
for x in marks:
    if x not in new_marks:
        new_marks.append(x)
print(new_marks)

OUTPUT :

No comments:

Post a Comment

Write a Java program to display given extension files from a specific directory on server machine.

 DOWNLOAD     SLIP14Q2 /** * STEPS TO RUN CODE * Step 01 compile the code * Step 02 run the code * Step 03 give a file directory locatio...