Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

which program will have the output shown below? 15 16 17 >>> for count …

Question

which program will have the output shown below? 15 16 17 >>> for count in range(18): print(count) >>> for count in range(17): print(count) >>> for count in range(15, 18): print(count) >>> for count in range(15, 17): print(count)

Explanation:

Step1: Analyze range(18)

The range(18) generates numbers from 0 to 17, so it won't start from 15.

Step2: Analyze range(17)

The range(17) generates numbers from 0 to 16, won't start from 15.

Step3: Analyze range(15, 18)

The range(15, 18) generates numbers 15, 16, 17 which matches the output.

Step4: Analyze range(15, 17)

The range(15, 17) generates numbers 15, 16, not including 17.

Answer:

>> for count in range(15, 18):

print(count)