हिंदी

Find the output of the following program segment: var = 7 while var > 0: print ('Current variable value: ', var) var = var -1 if var == 3: break else: if var == 6: var = var -1 continue - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Find the output of the following program segment:

var = 7
while var > 0:
          print ('Current variable value: ', var)
          var = var -1
          if var == 3:
              break
 else:
              if var == 6:
                      var = var -1
                     continue
 print ("Good bye!")
टिप्पणी लिखिए

उत्तर

OUTPUT: 

Current variable value: 7
Current variable value: 5
Good bye!
Current variable value: 4

shaalaa.com
The ‘While’ Loop
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Flow of Control - Exercise [पृष्ठ १४०]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
अध्याय 6 Flow of Control
Exercise | Q 5. (vi) | पृष्ठ १४०
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×