Find the output of the following Python Code: def PowerUp(N, Step=1): if N <=…

PYQ KVS TGT/PGT 2026

Find the output of the following Python Code:

def PowerUp(N, Step=1):
    if N <= 0:
        return 0
    else:
        Res = N + PowerUp(N - Step, Step)
        return Res
V1 = PowerUp(4)
V2 = PowerUp(5, 2)
print("Val 1:", V1)
print("Val 2:", V2)
print("Step Check:", PowerUp(Step=3, N=6))
print("Final Calculation:", V1 + V2)

Attempted by 14 students.

Sign up free to check your answer

Sign up free

Explore the full course: Kvs Nvs Tier 2 Computer Science

Loading lesson…