InfytQ Control structures -Quiz 3

Question 1

Time: 00:00:00
Types of loops in python

for , while,do-while

for , while,do-while

for , while

for , while

while,do-while

while,do-while

for , while,do-while,switch

for , while,do-while,switch

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
While loop is a:

Only type of loop in python

Only type of loop in python

Exit controlled loop

Exit controlled loop

Entry controlled loop

Entry controlled loop

All the above

All the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
Can we traverse and print elements in an array using for loop in single line

YES

YES

NO

NO

We can traverse but cannot print elements

We can traverse but cannot print elements

We can print but cannot traverse

We can print but cannot traverse

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
Consider array=[1,2,3,4,5]

How can we traverse through each element of an array and to print it using a for loop?

for i in range(5):print(array[i])

for i in range(5):print(array[i])

for i in array: print(i)

for i in array: print(i)

for i in range(len(array)):print(array[i])

for i in range(len(array)):print(array[i])

All the above

All the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Which loop is used for an indefinite type of iteration?

While loop

While loop

For loop

For loop

do-while loop

do-while loop

all the above

all the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
Which is not a loop control statement in python

continue

continue

break

break

goto

goto

pass

pass

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00

for i in range(10):
    i-=2


How many times the below loop iterate 

10

10

5

5

11

11

6

6

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
Which false regarding loops in python:

While loop is used when multiple statements are to be executed repeatedly until the given condition becomes True

While loop is used when multiple statements are to be executed repeatedly until the given condition becomes True

Loops are used to perform task repeatedly

Loops are used to perform task repeatedly

Loops should end with the keyword end

Loops should end with the keyword end

For loop can be used to iterate through lists

For loop can be used to iterate through lists

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
Identify true statement according to control statements

Break is used to exit from the current loop

Break is used to exit from the current loop

Break is used to exit from the current running program

Break is used to exit from the current running program

Continue is used to exit from current loop

Continue is used to exit from current loop

Continue is used to continue the execution of program even in the presence of break

Continue is used to continue the execution of program even in the presence of break

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/0

Accuracy

0%

Comments