标签: python-3.x
如何返回列表中的内容?例如,如果你有List = [a,b,c]和用户输入c,程序应该返回2.我怎么能编码呢?
答案 0 :(得分:1)
试试这个:
> my_list = ["a", "b", "c"] > my_list.index("c") 2