回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>有人能帮我解决我的问题吗?
问题是</p>
<p>如果iam输入int(1,2,3,4,5,6,7,8,9,0)总是错误?你知道吗</p>
<pre><code>data = input()
array = list(data)
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,
"0":180,
"1":270,
"2":0,
"3":90,
"4":180,
"5":270,
"6":0,
"7":90,
"8":180,
"9":270,
"!":0,
"@":90,
"#":180,
"$":270,
"%":0,
"^":90,
"&":180,
"*":270,
"(":0,
")":90,
"-":180,
"_":270,}
for i in range(len(array)):
print(array[i])
print(("{["+array[i]+"]}").format(table))
</code></pre>
<p>错误位置:</p>
<p>例如:如果am输入a#2</p>
<pre><code>print(("{["+array[i]+"]}").format(table))
KeyError: 2
</code></pre>