Ответ:
numbers = "1234567890"
max_count_of_nums = 0
count_of_nums = 0
my_str = input("Введите строку: ")
for i in my_str:
if i in numbers:
count_of_nums += 1
if count_of_nums > max_count_of_nums:
max_count_of_nums = count_of_nums
else:
print("Максимальное число повторяющихся цифр в строке: ", max_count_of_nums)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
numbers = "1234567890"
max_count_of_nums = 0
count_of_nums = 0
my_str = input("Введите строку: ")
for i in my_str:
if i in numbers:
count_of_nums += 1
if count_of_nums > max_count_of_nums:
max_count_of_nums = count_of_nums
else:
count_of_nums = 0
print("Максимальное число повторяющихся цифр в строке: ", max_count_of_nums)