[Python] How can I print the result of a function in Python? [duplicate]

Discussão em 'Python' iniciado por Stack, Abril 17, 2025.

  1. Stack

    Stack Membro Participativo

    This is my Python code which, when I run, lacks any printed number.

    def fib(a):
    while a - 2 > 0:
    def fib(a):
    fib(a - 1) + fib(a - 2)
    if a == 1: # Lines 5 to 10 are intended
    def fib(a): # to act as a scaffolding
    fib(a) == 1 # for the fib(a) function.
    if a == 2:
    def fib(a):
    fib(a) == 1
    print(fib(a)) # This is the failing line.

    fib(3)

    Continue reading...

Compartilhe esta Página