TOPIC
PYTHON-WA 30%
Kubik asked 3 years ago
Não consegui entender o motivo de apresentar erros, fiz vários testes e o código funcionou bem:
n = int(input())
seq = [] i = 0 while i < n: seq.insert(i, str(input())) if len(seq[i]) != (seq[i].count('<') + seq[i].count('>') + seq[i].count('.')): print('Só são permitidos os caracteres <, > ou .') elif (len(seq[i]) > 1000): print('Esta linha contem MAIS de 1000 caracteres. Corrija!') else: i = i + 1
for i in range(0, n): conta_maior = seq[i].count('>') conta_menor = seq[i].count('<') if conta_maior > conta_menor: print(conta_menor) else: print(conta_maior)
============
This topic has not been answered yet. Be the first!