Someone can help me to complete this source code am input String, change to array list, and output that int in that table
x = input()
y = list(x)
table = {" ":270,
"a":0,
"b":90,
"c":180,
"d":270,
"e":0,
"f":90,
"g":180,
"h":270,
"i":0,
"j":90,
"k":180,
"l":270,
"m":0,
"n":90,
"o":180,
"p":270,
"q":0,
"r":90,
"s":180,
"t":270,
"u":0,
"v":90,
"w":180,
"x":270,
"y":0,
"z":90,}
for i in range(len(y)):
print(y[i])
print("{["+y[i]+"]}".format(table))
Error at
print("{["+y[i]+"]}".format(table))
Example: for input abc the expected output should be:
a
0
b
90
c
180
range(len(y))will fail because indexes of lists start at0not at1.