求助大佬!!Python第4个点WA

P5730 【深基5.例10】显示屏

hao010819 @ 2022-04-03 00:37:02

本来全RE,好不容易调好了,结果第四个点WE了,救救孩子。 On line 3 column 26, read ., expected X

x = [['XXX', 'X.X', 'X.X', 'X.X', 'XXX'], ['..X', '..X', '..X', '..X', '..X'],
     ['XXX', '..X', 'XXX', 'X..', 'XXX'], ['XXX', '..X', 'XXX', '..X', 'XXX'],
     ['X.X', 'X.X', 'XXX', '..X', '..X'], ['XXX', 'X..', 'XXX', '..X', 'XXX'],
     ['XXX', 'X..', 'X.X', 'X..', 'XXX'], ['XXX', '..X', '..X', '..X', '..X'],
     ['XXX', 'X.X', 'XXX', 'X.X', 'XXX'], ['XXX', 'X.X', 'XXX', '..X', 'XXX']]

n = int(input())
a = input().split()
d = str(a[0])
b = len(d)
for i in range(5):  # 打印 5 行
    p = []
    for j in range(b):  # 打印 b 组
        p.append(x[int(d[j:j+1])][i])

    print(".".join(x for x in p))

|