I am studying Python, so it is very easy task. I want to get best and most elegant way to solve each simple task. The task is: Write a program that reads the integers from the console one number per line. For each entered number check:
if the number is less than 10, skip that number;
if the number is greater than 100, stop to read the numbers; Print all numbers that does not satisfy those two conditions.
lst = [] num = 0 while num <=100: num = int(input()) if num > 100: break if num >= 10: lst.append(num)
print('\n'.join(str(value) for value in lst))
Write a program that reads the integers from the console one number per line. For each entered number check:
- if the number is less than 10, skip that number;
- if the number is greater than 100, stop to read the numbers;
Print all numbers that does not satisfy those two conditions.
lst = []
num = 0
while num <=100:
num = int(input())
if num > 100:
break
if num >= 10:
lst.append(num)
print('\n'.join(str(value) for value in lst))