MCQ Answer

<p>How many numbers will be printed by the following code?</p><pre>def fun(a,b):<br>&nbsp; &nbsp; for x in range(a,b+1):<br>&nbsp; &nbsp; &nbsp; &nbsp; if x%3==0:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print(x,end=" ")<br>fun(100,120)</pre>

How many numbers will be printed by the following code?

def fun(a,b):
    for x in range(a,b+1):
        if x%3==0:
            print(x,end=" ")
fun(100,120)


निम्नलिखित कोड से कितनी संख्याएँ प्रिंट होंगी?

def fun(a,b):
    for x in range(a,b+1):
        if x%3==0:
            print(x,end=" ")
fun(100,120)
Topic : Functions in Python

A. 7

B. 8

C. 6

D. 9




Correct Answer is :

A. 7



Explanation

The output is:

102 105 108 111 114 117 120 

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad