Question: Lab: Show the output that would be generated by each of the following program fragments. Make sure to put these statements inside def main() and

Lab:

Show the output that would be generated by each of the following program fragments.

Make sure to put these statements inside def main() and main() as a complete .py file, then run it.

Be very careful about the indentation.

1.

for i in range (1,10):

print (i*i)

2.

for i in [2, 4, 6, 8, 10]:

print (i, ":", i**3)

3.

x = 1

y = 9

for j in range (0, y, x):

print(j, end="")

print(x + y)

4.

result = 0

for i in range (1, 11):

result = result + i*i

print(i)

print (result)

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!