Question: in python 2 Instructions Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not

 in python 2 Instructions Write a loop that reads positive integersfrom standard input and that terminates when it reads an integer that

in python 2

Instructions Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop terminates, it p rints out, on a line by itself, the sum of all the even integers read. Additional Notes: Regarding your code's standard output, CodeLab will check for case errors and will check whitespace (tabs, spaces, newlines) exactly. Interactive Session ? Visible newlines Visible whitespace Display stdin Display stdout Consider this data sequence: "311555 24 6 6 73-8". Any value that is the same as the immediately preceding value is considered a CONSECUTIVE DU PLICATE. In this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. Note that the last 3 is not a consecutive dupli cate because was preceded by a 7. Write some code that uses a loop to read such a sequence of non-negative integers, terminated by a negative number. When the code finishes executing, the number of consecutive duplicates encountered is printed. In this case, 3 would be printed. Additional Notes: Regarding your code's standard output, CodeLab will check for case errors and will check whitespace (tabs, spaces, newlines) exactly. Interactive Session ? O Visible newlines Visible whitespace Display stdin Display stdout 3

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!