Question
HELP PLEASE: Python program that uses a while loop to multiply integer factors entered by the user. The program should continue to accept integer factors
HELP PLEASE: Python program that uses a while loop to multiply integer factors entered by the user. The program should continue to accept integer factors until the user presses ENTER. The running product should be displayed after each input. See Sample Output.
** total is not defined** and I can't seem to keep the running multiplication going. Also, I thought I had correctly assigned the end of the loop with the variable I chose and it works when pressing ENTER - but I am unsure that is what is being asked.
This is my code so far:
# Ask user for integer product = 1
# Use while loop while True: number = int(input('Enter an integer factor or ENTER to quit: ')) # If the user presses 'ENTER' , end loop if number Enter an integer factor or ENTER to quit 3 The running product is now 3 Enter an integer factor or ENTER to quit 5 The running product is now 15 Enter an integer factor or ENTER to quit 6 The running product is now 90 Enter an integer factor or ENTER to quit 8 The running product is now 720 Enter an integer factor or ENTER to quit Program ended
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