小编Iri*_*Gal的帖子

Python列表/索引查询

我要求用户输入一个数字,我要在其中打印列表中该索引点处的项目.

这是我目前的代码:

List = ["a", "b", "c", "d", "e", "f"]

print "The list has the following", len(List), "list:", List

new_item = raw_input("Which item would you like to add? ")
List.append(new_item)
print "The list has the following", len(List), "items:", List

Number = raw_input ("Please select a number: ")
Run Code Online (Sandbox Code Playgroud)

python list

0
推荐指数
1
解决办法
1855
查看次数

标签 统计

list ×1

python ×1