English

Find the output of the following program segment: country = 'INDIA' for i in country: print (i) - Computer Science (Python)

Advertisements
Advertisements

Question

Find the output of the following program segment:

country = 'INDIA'
for i in country:
      print (i)
Short/Brief Note
Advertisements

Solution

The variable 'country' will act as a list of characters for the loop to iterate.

OUTPUT:
I
N
D
I
A

shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Flow of Control - Exercise [Page 140]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 6 Flow of Control
Exercise | Q 5. (iii) | Page 140
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×