Find the output of the following Python Code: def PatternLogic(N): for C in…

PYQ KVS TGT/PGT 2026

Find the output of the following Python Code:

def PatternLogic(N):
    for C in range(1, N + 1):
        Line = ""
        if C % 2 == 0:
            Line = str(C) + ("#" * C)
        else:
            Line = str(C) + ("*" * C)
        if C != 3:
            print(Line)
Num = 4
PatternLogic(Num)
print("Process Complete")

Attempted by 22 students.

Sign up free to check your answer

Sign up free

Explore the full course: Kvs Nvs Tier 2 Computer Science

Loading lesson…