Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

how can i remove duplicate from a list without using a for loop or while loop or any in-build function in python do’not use list comprehension as well.
- Rajeev
ints_list = [1,1,1,1] for x in ints_list: if ints_list.count(x) > 1: ints_list.remove(x) print(ints_list) # Output: [1,1]
- chirag maliwal
how can i remove duplicates using two for loop by comparing the list member and if match occur then simply remove the particular element
- RANA SIDHDHARAJSINH SAHDEVSINH
The count() method should never be used. The reason is you should never try to remove an element from a list while iterating on the list itself. The system may behave unexpectedly and skip over a particular item from the list as the list is constantly changing while the loop runs. Try the count() method on following list: values = [87, 94, 45, 94, 94, 41, 65, 94, 41, 99, 94, 94, 94] You’ll notice that the value 94 still stays in the final outcome. The best way is to use set method.
- Meet
values = [87, 94, 45, 94, 94, 41, 65, 94, 41, 99, 94, 94, 94] def removeDuplicate(z): for i in z: if z.count(i)>1: z.remove(i) removeDuplicate(z) return z print(removeDuplicate(values)) ************Output************** [87, 45, 65, 41, 99, 94]
- vikram ram raut