import math def simple_gen5(lst): for x in lst: if x >= 0: yield math.sqrt(x) else: yield None while True: print("генерация квадратных корней") print("1 - Ввести список") print("0 - Выход") choice = input("Выбор: ") if choice == "0": break if choice == "1": try: data = list(map(int, input("Введите числа через пробел: ").split())) gen = simple_gen5(data) print("Результат:") for val in gen: print(val) except: print("Ошибка ввода")