6.3 code practice: Question Edhesive

Write a loop to print 11 to 35 inclusive (this means it should include both the 11 and 35), 5 per line.

Expected output:

11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
26 27 28 29 30
31 32 33 34 35

Respuesta :

CPED

Answer:

The source code and output is attached

I hope it will help you!

Explanation:

Ver imagen CPED
Ver imagen CPED
fichoh

The program prints the numbers between 11 and 35(inclusive) with a maximum of 5 integer values per line. The program written in python 3 goes thus:

for i in range(11, 36):

#for loop iterates through the numbers to be printed, picking each one at a time

print(i, end=' ')

# display the value of each iterated value with the cursor remaining on the same line

if i%5 == 0:

#checks if the value of i leaves a remainder when divided by 5

print()

# if it does the cursor moves to the next line.

The sample run of the program is attached.

Learn more : https://brainly.com/question/14072501

Ver imagen fichoh