Consider the three code segments. What is the output of the…
Consider the three code segments. What is the output of the programs? Block-Based Pseudo-Code The pseudocode initializes list and sets temp to 0. For each item in the list, it checks if item MOD 2 equals 1. If true, item is added to temp. After the loop, temp is displayed. Python Program-Code list = [66,55,44,33,22,11]temp = 0for item in list: if (item % 2 == 1): temp = temp + itemprint(temp) Text-Based Pseudo-Code list ← [66,55,44,33,22,11]temp ← 0FOR EACH item IN list{ IF (item MOD 2 = 1) { temp ← temp + item }}DISPLAY (temp)
Read Details