Write a python program to display list of numbers and we want to return all the numbers from the list that are divisible by 2 and remove duplicates at the same time.
Write a python program to display list of numbers and we want to return all the numbers from the list that are divisible by 2 and remove duplicates at the same time.
Write a python program to display list of numbers and we want to return all the numbers from the list that are divisible by 2 and remove duplicates at the same time.
Program
def myfun():
arr = [10, 23, 30, 30, 40, 45, 50]
new_set = {num for num in arr if num % 2 == 0}
print(new_set)
if __name__=="__main__":
myfun()