TOPIC

Runtime error

Lucas Pinheiro asked 1 year ago

pal = input()
while pal != ".":

    vec = pal.split()
    k = 0
    l = ""

    d = dict()
    for i in vec:
        if i[0] not in d:
            k = (len(i) - 2)*vec.count(i)
            if k != 0:
                d[i[0]] = [i,k]
        else:
            k = (len(i) - 2)*vec.count(i)
            if k > d[i[0]][1]:
                d[i[0]] = [i,k]

    for i,j in d.items():
        l = i + "."
        for vi,v in enumerate(vec):
            if j[0] == v:
                vec[vi] = l

    print(" ".join(vec))
    print(len(d))

    for i,j in d.items():
        print(f"{i}. = {j[0]}")

    pal = input()

alguem saberia me dizer por que estou recebendo Runtime error?

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.