+ 1
Python Challenge!
There is an array 'nums' containing 7 integers from 1-6(including 1 and 6). Prove that one of the numbers is duplicate through a bool var 'is duplicate'.. Also tell that which number is the duplicate number. Please tell how to solve this question. My attempt: https://code.sololearn.com/cIbOVp8L8MH7/#py
4 ответов
+ 7
Kunsh-Tyagi
It would be great if you show your attempt!
Then we will help you🤝
Asking for readymade question is an offense.
Hope you understand 👍
+ 4
Where is your attemt?
+ 3
array.filter(lambda x:array.count(x) >1)
+ 2
Oh yeah! thanks for reminding me piyush
https://code.sololearn.com/cIbOVp8L8MH7/#py
it is saying "Traceback (most recent call last):
File "./Playground/file0.py", line 7, in <module>
d.append(d.index(x))
ValueError: 1 is not in list
"