2017-05-07 6 views

答えて

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'] 
関連する問題