Question: FIND OUT THE ERROR AND CORRECT IT PLEASE THANK YOU IN PYTHON Statement: Users will provide several numbers. We will add the 1st, subtract the

FIND OUT THE ERROR AND CORRECT IT PLEASE THANK YOU IN PYTHON

FIND OUT THE ERROR AND CORRECT IT PLEASE THANK YOU IN PYTHON

Statement: Users will provide several numbers. We will add the 1st, subtract the 2nd, add the 3rd and so on. This process will continue, until the user has put a blank line as an input (mentioned in the prelab report). Sample input: Please enter a number: 24 Please enter a number: 5 Please enter a number: 1 Please enter a number: 10 Please enter a number: 36 Please enter a number: 67 Please enter a number: Sample output: The result is = -21 The above output is obtained from 24 -5 +1 -10 + 36 - 67 = -21 Hints: Instead of just adding or subtracting the numbers (which can get complicated), why not multiply every 2nd number by -1 and then add it.] Below is the python code. sign = -1 S = input("Please enter a number: ") while s == "" sign = sign total = sign*temp s = input("Please enter a number: ") print("The result is: %d", total)

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