【发布时间】:2016-03-08 21:01:31
【问题描述】:
试图在字母列表(字母表)中找到用户输入的索引值。本质上从给定列表返回索引列表。
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
words = input("Type something: ").upper()
print (list(words))
print (list(alphabet))
#Substring not found,
print (alpha.index(words))
【问题讨论】:
-
字母!= alpha。你应该解决这个问题。