0
I’m trying to declare a function that shows a line below the result of another function. This line adapts to the size of the returned result in the 'main' function. Follow the code and error message that is showing:
from time import sleep
def mostraLinha(tamLinha):
print('=' * tamLinha)
print()
def maior(* n):
print('PROCESSANDO...', flush=True)
sleep(1.5)
for num in n:
sleep(0.6)
print(f'{num}', end = ' > ', flush=True)
if num == n[0]:
maior = num
else:
if num > maior:
maior = num
print()
print(f'Foram analisados {len(n)} números e o maior é o {maior}.')
parâmetro = len(n)
mostraLinha(parâmetro)
def mostraLinha():
print('=' * 25)
print()
print('Desempacotando PARÂMETROS')
print('-' * 30)
print()
maior(-5, 14, 102, 3, 5)
maior(3, 5)
maior(1056, 100456, 0, -345, 6, 7, 8, 15, 21)
ERROR MESSAGE:
MOSTRALINHA()
TAKES 0 POSITIONAL ARGUMENTS BUT 1 WAS GIVEN
Perfect William. I think I sent the wrong message, do you believe? It was not in the code block that second function! Details make the difference hehe
– Curi
@dev.Uri if solved the problem mark the answer as correct, thank you
– Guilherme Nascimento
Made friend! Getting the hang of it...
– Curi
@dev.Uri thank you/
– Guilherme Nascimento