Skip to content

Instantly share code, notes, and snippets.

View Dimitray-for-grsu's full-sized avatar

Gerasimchick Dimitray Dimitray-for-grsu

View GitHub Profile
packets = input("Введите данные: ")
if not all(char in '01' for char in packets):
print("Неверный ввод. Используйте только символы '0' и '1'!")
number_of_packets = len(packets)
number_of_loosing_packets = packets.count('0')
temp_number_of_loosing_packets = 0
list_of_loosing_sequences = []
percentage_of_loosing_packets = round(number_of_loosing_packets / number_of_packets * 100, 1)