Python 如何从包含字母位置的列表中找到字母的位置?

Python 如何从包含字母位置的列表中找到字母的位置?,python,list,Python,List,我有一个数字列表,它指的是它们在字符串中的位置,例如 x=[1,3,5,9,2] alphabet = abcdefghijklmnopqrstuvwxyz #the string print alphabet[:x] 我希望它返回给我“bdfjc”(python从0开始) 任何想法都将不胜感激 x=[1,3,5,9,2] alphabet = "abcdefghijklmnopqrstuvwxyz" #the string r = "" # The string to print out a

我有一个数字列表,它指的是它们在字符串中的位置,例如

x=[1,3,5,9,2]
alphabet = abcdefghijklmnopqrstuvwxyz #the string
print alphabet[:x]
我希望它返回给我“bdfjc”(python从0开始)

任何想法都将不胜感激

x=[1,3,5,9,2]
alphabet = "abcdefghijklmnopqrstuvwxyz" #the string
r = "" # The string to print out at the end
for i in x:
    r += alphabet[i]
print r