Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8
You can use a while loop and an exit condition. try this: buf = [] while True: inp = input('Name: ') if inp == 'xxx': break else: buf.append(inp) print(buf)
6th Jul 2019, 6:18 AM
Lothar
Lothar - avatar