Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions km73/Hnidak_Maryna/12/task3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
def groups(list, iterator):
"""
This function is the largest group
Args:
list: list, input parameter
iterator: integer, index
Returns:
max(a): integer, result of the program
Raises:
ValueError, OverflowError, ZeroDivisionError
Examples:
>>> print([1,1,1,2,2,1,3,3,3,4,],0)
"3"
:param list:
:param iterator:
:return:
"""
if iterator == len(list):
return max(a)
list_two = "".join(list)
count_of_element = list.count(list[iterator])
if (count_of_element - iterator)*str(list[iterator]) in list:
a.append(count_of_element - iterator)
return groups(list, iterator + 1)


a = []
list = input("Enter list : ").split()
print(groups(list, 0))