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.
Write a program that receives a number and prints the following figure according to the number received: Number: 55555 4444 333 2 2 1
Using JavaScript, send a request with the following specifications method = posturl = /test.php FNAME information =? Lname =? Age =? Get the information above through Prompt from the user
Write a function that receives a word and changes each letter to its next letter in the alphabet. Then returned the result. Indeed: "A" turns into "B" "" B "becomes" C "" C "becomes" D "and ........
Write a program that receives a solar date from the input (in the format of yyyy/mm/dd). Then convert the date to AD and print in the output
CSS code to select all the following elements at once and change their background color to yellow<div class="yellow" id="box"></div><div class="yellow"></div><div class="yellow mybox"></div>Footer call to action
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.