• Предмет: Информатика
  • Автор: bynalox
  • Вопрос задан 3 месяца назад

1 задачу помогите пожалуйста python

Приложения:

Ответы

Ответ дал: KiratorKanek
0

Ответ:

1)
string = input()

print(string.count('класс'))
2)
string = input()

a = [0]*len(string)

for i in range(0,len(string)):

   a[i] = string[i]

b = set(a)

print(len(b))
3)
def longest_sequence_of_k(text):

   max_count = 0

   current_count = 0

   for char in text:

       if char == 'k':

           current_count += 1

           if current_count > max_count:

               max_count = current_count

       else:

           current_count = 0

   return max_count

text = input()

result = longest_sequence_of_k(text)

print(result)

Вас заинтересует