答案 0 :(得分:0)
myList = []
while True:
word = input("Enter a Word (Type 'q' to quit): ")
if word == 'q':
break
myList.append(word)
print(myList)
<强> RESULT 强>
Enter a Word (Type 'q' to quit): cat
Enter a Word (Type 'q' to quit): dog
Enter a Word (Type 'q' to quit): rat
Enter a Word (Type 'q' to quit): q
['cat', 'dog', 'rat']