Question: Examine the following code: negatives = zeros = positives = line = input(Enter an integer (blank to quit): ) while line != : num =

Examine the following code: negatives = zeros = positives = line = input("Enter an integer (blank to quit): ") while line != "": num = int(line) if num 0: 16 positives.append(num) 11 else: 12 zeros.append(num) 13 line = input("Enter an integer (blank to quit): ") 14 for n in negatives: 15 print(n) 16 for n in zeros: 17 print(n) 18 for n in positives: 19 print(n) wmummpwmp Answer the following: a. What is the purpose of the code? Explain the working of the code by taking 10 sample inputs containing positive, negative and zeros. First input should be the last two digits of your roll number and second input should be the number of your month of birth (e.g. input 7 if you were born in July). b. In your opinion, is it possible to generate the same functionality of code by using other data structure(s)? Transform the above code by using other appropriate data structure(s) such that overall function (purpose) of the code remains the same
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
