diff --git a/practica/stepik/stepik_tasks/sum_num_from_last.py b/practica/stepik/stepik_tasks/sum_num_from_last.py index 94710ab..bc424ba 100644 --- a/practica/stepik/stepik_tasks/sum_num_from_last.py +++ b/practica/stepik/stepik_tasks/sum_num_from_last.py @@ -1,12 +1,12 @@ # # начиная с конца обьединяет элементы между собой -# initial_list = input().split() -# sum_list = [] -# left_index = -1 -# right_index = -len(initial_list) + 1 -# middle_index = 0 -# while middle_index < len(initial_list): -# sum_list.append(initial_list[left_index] + initial_list[right_index]) -# left_index += 1 -# right_index += 1 -# middle_index += 1 -# print(sum_list) +initial_list = input().split() +sum_list = [] +left_index = -1 +right_index = -len(initial_list) + 1 +middle_index = 0 +while middle_index < len(initial_list): + sum_list.append(initial_list[left_index] + initial_list[right_index]) + left_index += 1 + right_index += 1 + middle_index += 1 +print(sum_list)