TOPIC

Presentation Error

roche_braziliano asked 7 months ago

v = "\n"
trace = False
while True:
    try:
        inp = input()
        if "<body>" in inp:
            trace = True
        if "</body>" in inp:
            trace = False
        if trace == True and "<body>" not in inp:
            v = v + inp + "\n"         
    except EOFError:
        break
print(v)

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

  • Diego Borba replied 7 months ago

    Desiste do método de usar lista, e printa direto do input() que funciona Assim:

    trace = False
    while True:
        try:
            inp = input()
            if "<body>" in inp:
                trace = True
            if "</body>" in inp:
                trace = False
            if trace == True and "<body>" not in inp:
                print(inp)
        except EOFError:
            break