while True:
value = input("Please input a to-do task, or 'q' to quit: ")
if value == "q":
break
Code example: while loop
tasks = []
while True:
value = input("Please input a to-do task, or 'q' to quit: ")
if value == "q":
break
tasks.append(value)
print(tasks)
Code example: while loop
tasks = []
while True:
value = input("Please input a to-do task, or 'q' to quit: ")
if value == "q":
break
if len(value) > 0:
tasks.append(value)
print(tasks)
Code example: while loop
tasks = []
while True:
value = input("Please input a to-do task, or 'q' to quit: ")
if value == "q":
break
tasks.append(value)
print(", ".join(tasks))
Code example: while loop
tasks = []
while True:
value = input("Please input a to-do task, or 'q' to quit: ")
if value == "q":
break
tasks.append(value)
print("\n".join(tasks))