Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions