Question: PARTICIPATION ACTIVITY 5 . 8 . 1 : Nested loops. 1 ) Given the following code, how many times will the inner loop body execute?

PARTICIPATION ACTIVITY
5.8.1: Nested loops.
1)
Given the following code, how many times will the inner loop body execute?
for i in range(2):
for j in range(3):
# Inner loop body
Check
Show answer
2)
Given the following code, how many times will the print statement execute?
for i in range(5):
for j in range(10,12):
print(f'{i}{j}')
Check
Show answer
3)
What is the output of the following code?
c1='a'
while c1<'b':
c2='a'
while c2<='c':
print(f'{c1}{c2}', end ='')
c2= chr(ord(c2)+1)
c1= chr(ord(c1)+1)
Check
Show answer
4)
What is the output of the following code?
i1=1
while i1<19:
i2=3
while i2<=9:
print(f'{i1}{i2}', end='')
i2= i2+3
i1= i1+10
Check
Show answer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!