Question: This script is intended to have the user input integers on the keyboard until a negative integer is an input, and then print the

This script is intended to have the user input integers on the

This script is intended to have the user input integers on the keyboard until a negative integer is an input, and then print the product of all the positive values. Unfortunately, it does not work. Why? product = 1 s = input("Enter an integer: ") = int(s) while x < 0: if x > 0: product = s = input("Enter an integer: ") x = int(s) print(product)

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!