Advertisements
Advertisements
Question
Find the output of the following program segment:
var = 7
while var > 0:
print ('Current variable value: ', var)
var = var -1
if var == 3:
break
else:
if var == 6:
var = var -1
continue
print ("Good bye!")Short/Brief Note
Advertisements
Solution
OUTPUT:
Current variable value: 7
Current variable value: 5
Good bye!
Current variable value: 4
shaalaa.com
Is there an error in this question or solution?
