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 remove (list):
repeat = []
for x in list:
if x not in repeat:
repeat.append(x)
print (repeat)
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)
Submitting answers is currently unavailable.
Write a program that receives 2 numbers as the interval, in which the interval of all the 5 existing numbers. For example, in the interval of 1 to 20 the number 2 times the number 5 repeated (5 and 15)
Write a program that can obtain the average infinite number of numbers: First, the program must receive the user's numbers (until the user does not enter the number 0, the numbers must continue ...
Write a program that receives text from the input and prints the translation in the output. It can also be able to get English text from the entrance and convert it to a coder. Input: hooshang ....--- .... ...
Write a program that receives a number from the user and converts to letters suppose the numbers entered between 0 and 1000000 23 ➞ Twenty Three 405 ➞ Four HundredR
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.