[Python] Wrong output in Python Return statement [closed]

Discussão em 'Python' iniciado por Stack, Setembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    def avg(*numbers):
    sum = 0
    for i in numbers:
    sum = sum + i
    return sum / len(numbers)
    c = avg( 8, 5, 1, 6, 7, 8, 4, 9)
    print( c )


    This is showing me an output = 1 but, it should be 6 and if i am wrong please help me

    it is a return statement program but, it is showing me a different output

    Continue reading...

Compartilhe esta Página