Home / Programming MCQs / Python MCQs / Question

R

Ram Sharma • 188.81K Points
Coach

Q. What will be the result of following Python code snippet after execution?

Code:
str1=""

i=0

var2=1

while(i<3):

    var1=1

    if str1:

        var2=var1*var2+5

    else:

        var2=var1*var2+1

    i=i+1

print(var2)
(A) 4
(B) 11
(C) 12
(D) 16

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.