-4
I’m solving a college list, but I can’t find a way to show the numbers count without repeating the print. For example, when the number is repeated I want to print only once and I am not able to do it, because whatever sweeps the list makes the count appear repeatedly. Follows the code
numero = int(input("Número: "))
freio = 0
l = []
while numero != freio:
l.append(numero)
numero = int(input("Número: "))
for x in l:
if l.count() == 1:
print("O Número ", x, "aparece", l.count(x), "vez.")
else:
print("O Número ", x, "aparece", l.count(x), "vezes.")
If anyone can help me I’d be grateful.
Dei downvote pq I believe that your question is outside the scope of the site (is an example of this case: https://pt.meta.stackoverflow.com/questions/5483/manual-de-como-n%C3%83o-fazer-perguntas/5486#5486 ). As always, I am willing to reevaluate my vote in the face of a reformulation. Abs,
– Lucas