Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started