Recently I started diving into python a bit, unfortunately I am struggling in the very beginning. What is the best and the most elegant way to abort user input after an empty string is entered?
The approach I tried wont break the input no matter what I enter.
def populate_list():
list=[]
while True:
try:
list.append(input("Enter values: "))
except EOFError:
break;
return list