Break Continue in Python MCQs Exercise I


Ques 1 Break Continue


"break" is the keyword that comes out from the loop body.
  a) True
  b) False
  c) None
  d) Not define


a is the correct option





Ques 2 Break Continue


What is the output of the following Python Code?


  i,j=4,5
  count=0
  while i!=0 and j>=0:
    count=i-1
    j=count-i
    if i==j:
        break
    print(i,end=" ")

  a) 5
  b) 5 2 -1
  c) 4 2 -1
  d) 4


d is the correct option





Ques 3 Break Continue


What is the output of the following Python Code?


 i,j=4,5
 count=0
 for i in range (i,i+j,i):
     count=i-1
     j=count-i
     if i==j:
         break
     print(count,end=" ")

  a) 5 7
  b) 5 2 0
  c) 4 7
  d) 9 12


c is the correct option





Ques 4 Break Continue


What is the output of the following Python Code?


int=10
for i in range(0,int):
    if i%2==0:
        continue
    if i%2!=0:
        print(i,end=" ")

  a) 1 3 5 7 9
  b) 0 2 4 6 8
  c) Error,int is keyword.
  d) None of these.


a is the correct option





Ques 5 Break Continue


What is the output of the following Python Code?


int=10
for i in range(0,int):
    for j in range(0,int+int):
        if i^i==i-j:
            print(i-j,end=" ")
            break

  a) 0
  b) 0 0 0 0 0 0 0 0 0 0
  c) Error,int is keyword.
  d) None of these.


b is the correct option