Question: Value num_input is read from input. Write a while loop that iterates until num_input is negative. In each iteration: Update value output_num as follows: If

Value num_input is read from input. Write a while loop that iterates until num_input is negative. In each iteration: Update value output_num as follows: If num_input is even, subtract num_input from output_num. Otherwise, add num_input to output_num. Then, read a value from input as an integer into variable num_input. output_num = 0 num_input = int(input()) while num_input >= 0: if num_input % 2 == 0: # num_input is even output_num -= num_input else: # num_input is odd output_num += num_input num_input = int(input() print(f'Output number is {output_num}')

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