Q. Find the output of the following program segments:


(a)

for i in range(20,30,2):

    print(i)


(b)

country = 'INDIA'

for i in country:

    print (i)


(c)

i = 0; sum = 0

while i < 9:

    if i % 4 == 0:

        sum = sum + i

    i = i + 2

print (sum)


Answer:-

(a)
20
22
24
26
28
>>>

(b)
I
N
D
I
A
>>>

(c)
12
>>>

1 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post