Question: Python Write a for loop with a range function and format output ascurrency Use an input statement to ask the user for # of iterations

Python

Write a for loop with a range function and format output ascurrency
Use an input statement to ask the user for # of iterations usingthe prompt: #? [space after the ?] & assign to a variable
Convert the variable to an integer
Use a for loop and a range function to display all whole numbersfrom 1 to the user entered number
Display the value of the item variable on screen in each iterationin the following format:
The price is [item variable in currency format]!
(hint: use the format specifier $%.2f)
After the for loop ends, display the user entered number ofiterations

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 Programming Questions!