logo

Crowdly

When applied to a list, the count() method counts the number of times an occuren...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

When applied to a list, the count() method counts the number of times an occurence appears in the list.

For example:

[1,2,3,10,10].count(1) returns 1

[1,2,3,10,10].count(10) returns 2

[1,2,3,10,10].count(0) returns 0

We want to write a function that takes a list of integers and returns True when it contains exactly two occurences of the number 10 and at least three occurences of number 5, and False otherwise. What is the best way to replace xxxx in the following code to achieve our goal?

def test(list_nbs):

xxxx

75%
25%
0%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.essec.fr?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!