# -*- coding: utf-8 -*-
"""ln 6 Book Back Exercises_Flow of Control.ipynb
Automatically generated by Colaboratory.
Original file is located at
    https://colab.research.google.com/drive/1oyRlFuiHoMn-G11_R2wbgZcOfNn3qW3J
#About this notebook
Notebook made by: Dhananjay M.R
Subject: Computer Science - Grade 11 CBSE
Language: - Python
Topic: Book Back Exercise Questions of the lesson - Flow of control
Execution mode: Script Mode
Note: Theory based questions are not available in this notebook.

Note: This is a compilation of the entire book. 
If you run this program directly, you may encouter with error.
Therefore it is recommended to cut the program (modify) and run it part by part

Refering the original file at Colaboratory is recommended for better understanding of the codes
Original file is located at
    https://colab.research.google.com/drive/1oyRlFuiHoMn-G11_R2wbgZcOfNn3qW3J
    

#Qn No.5 Find the output of the following program segments:
"""

# Part i
print('Output for part i of the segment:')
a = 110
while a > 100:
  print(a)
  a -= 2
print('')
# End of part i

# Part ii
print('Output for part ii of the segment:')
for i in range(20,30,2):
  print(i)
print('')
# End of part i

# Part iii
print('Output for part iii of the segment:')
country = 'INDIA'
for  i in country:
  print(i)
print('')
# End of part iii

# Part iv
print('Output for part iv of the segment:')
i = 0; sum = 0
while i < 9:
  if i % 4 == 0:
    sum = sum + i
  i = i + 2
print(sum)
print('')
# End of part iv

# Part v
print('Output for part v of the segment:')
for x in range(1,4):
  for y in range(2,5):
    if x * y > 10:
      break
    print(x * y)
print('')
# End of part v

# Part vi
print('Output for part vi of the 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')
# End of part vi
