- 2

How would you solve this case? to find copies in a list.

you put a "k" number how represents a range with a for you review a list as "1 2 3 1 2" or "1 2 1 2 1" in k range Result: input = 3 list = 1 2 3 1 2 print = 2 or input = 2 list = 1 2 1 2 1 print= 3

18th Jun 2021, 2:31 AM
Diana Miranda
Diana Miranda - avatar
8 Respuestas
0
List declaration always start with a square bracket [ ] . example My_list =[1,2,3 ]
18th Jun 2021, 9:40 PM
Mina Puker
+ 2
No, explanation is ok (I guess), the bad thing is your terrible English. But I think I got your point. You want to make a code that will determine how many duplicates list contains. Am I right? If so following code can make you happy: https://code.sololearn.com/cEwLkuTDm7ha/?ref=app
18th Jun 2021, 7:20 AM
Shadoff
Shadoff - avatar
+ 2
I am sorry for my bad english! thanks for your contribution
18th Jun 2021, 7:34 AM
Diana Miranda
Diana Miranda - avatar
+ 2
Diana Miranda , even if the task may already be done, i am interested in knowing what these two inputs / numbers mean. can you just help me to better understand? thanks!
18th Jun 2021, 11:00 AM
Lothar
Lothar - avatar
+ 1
Strange, but True. Your question was pretty much clear, until you wrote a description! What is the "input = 3" means? What is the "print = 2" means? If you want to remove duplicates inside the list it is enough to do like this: x = [1,2,1,2,3,4,5,6,6,6] z = list(set(x)) # also if you want to sort it from small to big: z = sorted(z) #now let's print it out and see the result: print(z)
18th Jun 2021, 2:41 AM
Shadoff
Shadoff - avatar
+ 1
De nada. ¡qué lo pase bien!
18th Jun 2021, 7:48 AM
Shadoff
Shadoff - avatar
+ 1
the input corresponds to a revision range in the list! the goal is for me to tell you how many copies are in a numerical list, I hope it's clear.
18th Jun 2021, 9:18 PM
Diana Miranda
Diana Miranda - avatar
- 1
That's truth! A list is with [ ]
18th Jun 2021, 9:52 PM
Diana Miranda
Diana Miranda - avatar