[Python] Why is my Python function returning None instead of a value? [duplicate]

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

  1. Stack

    Stack Membro Participativo

    I'm trying to write a function that calculates the square of a number, but it always returns None. Here's my code:

    def square(num):
    num * num
    result = square(4)
    print(result)


    What am I doing wrong?

    Continue reading...

Compartilhe esta Página