Question

# For Loops Assignment Before you start…. Create a folder on your flash drive called Lab7 inside...

For Loops Assignment

Before you start….

Create a folder on your flash drive called Lab7 inside your CS0016 folder.

When writing your programs make sure you include the 4 comments at the top

Programs

1. Start up IDLE3.8 and open a scripting window.

2. Write a program to solve the following problem:

powers: Write a program to display the following table with headings and totals. You must use variables to represent all quantities and a for loop for repetition.

x x^2 x^3

11 121 1331

14 196 2744

17 289 4913

20 400 8000

23 529 12167

26 676 17576

29 841 24389

32 1024 32768

35 1225 42875

38 1444 54872

Totals: 245 6745 201635

Program

``````x=0
x2=0
x3=0
#for i in list [11,14,17,...,38]
for i in range(11,41,3):
#printing i, i^2, i^3
print(i, i**2, i**3)
x+=i
x2+=i**2
x3+=i**3
#printing totals
print("Total:",x,x2,x3)
``````

Program Screenshot

Output Screenshot

Each and everything is explained in comment section of the code.

Thank you! Hit like if you like my work.

#### Earn Coins

Coins can be redeemed for fabulous gifts.