message = “Введите ваш возраст (или ‘quit’ для завершнения): ”
flag = True numbers = [] for n in range(0,1000_000): n = str(n) numbers.append(n) while flag == True: age = input(message) if age != 'quit' and age in numbers[:]: age = int(age) if age < 3: print ('free') elif age >= 3 and age < 12: print ('10$') elif age >= 12: print ('15$') elif age == 'quit' and age not in numbers[:]: break elif age != numbers[:]: flag = False