- 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
8 Respuestas
0
List declaration always start with a square bracket [ ] . example
My_list =[1,2,3 ]
+ 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
+ 2
I am sorry for my bad english! thanks for your contribution
+ 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!
+ 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)
+ 1
De nada.
¡qué lo pase bien!
+ 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.
- 1
That's truth! A list is with [ ]