Hope everyone is doing good. I just joined this platform. So, I have just started learning python about a week or so from YouTube. This is my first program please tell me what am I doing wrong here. I want the program to display message if the user input is not in the list and continue asking for another input! Thank you.
numbers = [7,3,13,6,8,5,1,2,4,15,9,10,12,14,11]
new_list = []
while True:
num = int(input("Enter any number from the list 'numbers': "))
for i in numbers:
if i < num:
new_list.append(i)
new_list.sort()
elif num != i:
print("Number doesn't exist in the list 'numbers'")
break
print(new_list)