Question: Task: Compute n * * x In this part of the assignment, you will write a program that, when given positive integers n and x

Task: Compute n ** x
In this part of the assignment, you will write a program that, when given positive integers n and x, will create a list containing 0x,1x,2x,3x,..., nx.
When the program is executed, it will ask the user to enter 2 positive integers n and x, and it will store it into 2 variable: n and x. This is done for you in the code we have provided at the top of the program (between the two ### DO NOT MODIFY ### comments). Below the # YOUR CODE HERE comment, you will write the code to create a list called powers containing the following n +1 items:
powers[0] should be 0** x
powers[1] should be 1** x
powers[2] should be 2** x
...
powers[n] should be n ** x
At the bottom of the program (between the two ### DO NOT MODIFY ### comments), we provide code to print powers in order to display the contents of powers to you (in order to help you debug).
For example, if you run your program as follows:
Enter positive integer n: 6
Enter positive integer x: 2
Your program should print the following:
[0,1,4,9,16,25,36]

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!