Remove array duplicates
Write a function that receives a list (array) as a parameter, and deletes its duplicate items and returns the new (array) list
Write a function that receives a list (array) as a parameter, and deletes its duplicate items and returns the new (array) list
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
def Removeduplicate(lst): return list(set(lst)) print(Removeduplicate(lst=input("Enter list elements: ").split(',')))
def remove_duplicates(input_list): """این تابع آیتمهای تکراری را از لیست حذف کرده و لیست جدیدی برمیگرداند.""" # Use set (SET) to remove duplicates unique_list = list(set(input_list)) return unique_list # Example of the use of function original_list = [1, 2, 3, 4, 2, 3, 5, 1, 6] new_list = remove_duplicates(original_list) print("لیست اصلی:", original_list) print("لیست بدون تکراری:", new_list)
def hazf(x): y = set(x) y = list(y) return y lists = [] while True: x = input('kalame ra vared konod ya jahat moshahede faghat enter bezanid: ') if x == '': print(f'without : {hazf(lists)}') break lists.append(x)
def num(x): a = list(set(x)) return a print(num([3 , 5 , 8 , 5]))
lst = [] while True: name = input("name: ") lst.append(name) if name == "0": break def a(li): s = set(li) l = list(s) for item in l: print(item) a(lst)
s =[] i = 1 a = int(input(" tedad araeh :")) while i <= a : j = str(input("araeh {} : ".format(i))) s.append(j) i += 1 print ("list asli : " , s) t = set(s) print("list gher tekrari : ",t)
def remov_duplicate(list : list): remov_duplicate_list = [] for i in list: if i in remov_duplicate_list: pass else : remov_duplicate_list.append(i) remov_duplicate_list.sort() return remov_duplicate_list my_list = [1,2,3,6,3,1,4,7,8,9,9,3,1,2] print(f'duplicate list : {my_list}') print(f'remov duplicate list : {remov_duplicate(my_list)}')
Submitting answers is currently unavailable.
To DIV below what css slide to make the heart shape<div class="heart"></div>
Write a library program that has the following features: 1- The user can register a new book 2- The user can delete recorded books 3- The user can change the specifications of the books including their name and subject ...
Create a link with the following specifications. The phrase link (click here) should be on the code-bezan.ir page Title the phrase (programming exercise) be open but open on the new page
Using HTML and CSS, insert an image with the following features on the page.
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.