Question: Exercise # 1 While Signs ( use while loop ( s ) ) You know how to determine if numbers are positive or negative (
Exercise # While Signs
use while loops
You know how to determine if numbers are positive or negative we wrote a
program for it before in lecture class Let's do more things with positive and
negative numbers! You will create a function that distributes numbers entered by
the user into separate lists of positive and nonnegative numbers meaning
includes zero and negative numbers Your program will read numbers from the
keyboard until the user inputs a q
Name your program whilesigns.py Write a function getpositivenegative
that:
Repeatedly reads keyboard entries until the user inputs a q The
prompt should be Input? with a single space after the question mark
Appends each float input into the appropriate list: positive numbers or
nonnegative numbers
Returns the two lists as a tuple, positives first.
For instance:
Input?
Input?
Input?
Input?
Input? q
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
