Important Python Mcqs

What is sum after the following loop terminates?

sum = 0
item = 0
while item < 5:
    item += 1
    sum += item
    if sum > 4:
        break
a) 5
b) 6
c) 7
d) 8

Answer:

b) 6

Related MCQs

The main method header is written as?

a. public static void main(string[] args) b. public static void Main(string[] args) c. public static void main(Strings[] args) d. public static void main(String[] args) Answer:

A Java variable is the name of a

a. data value stored in memory that can change its value but cannot change its type during the program’s execution b. data type stored in

Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?