python的 raw_input 用法。
1个回答
展开全部
record = []
while True:
info = []
userInput = raw_input('Enter something: ')
if userInput == "exit":
break
else:
info=userInput.split(",")
record+=[info]
print record
输入的时候把内容用逗号隔开.
输入exit终止循环.
Enter something: hello, hi
Enter something: good, bad
Enter something: red, green
Enter something: exit
[['hello', ' hi'], ['good', ' bad'], ['red', ' green']]
>>>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询