刚开始使用 python 2.7.5 进入数组。我的目标是要求用户输入并将输入存储在多个数组中。
到目前为止,这就是我所拥有的,就存储多个带有输入的数组而言。尝试在最后打印输入时遇到错误。
这是我到目前为止的代码。
# want user to enter a list of employee names, error occurs when trying to recall user entry
emp_name = [0]
emp_name = raw_input("please enter employee name")
while emp_name !="neg":
emp_name = raw_input("please enter employee name,enter neg to exit")
print "employee 2 is:", emp_name[1] #I want the 2nd name entered to appear