Question: Problem 4: Write a Python program that asks user to input a positive integer n and prints out certain numbers. a. Print the first n
Problem 4: Write a Python program that asks user to input a positive integer n and prints out certain numbers.
a. Print the first n cubes.
For example, if n = 4, the output is:
1
8
27
64
b. Print perfect cubes < n.
For example, if n = 30, the output is:
1
8
27
c. Print the sum of i**3 for all 1 <= i <= n.
For example, if n = 5, the output is:
225
(Use while loops)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
