Question: What number will be printed on the console by the code below: numbers [6, 4, 3, 8, 4, 12, 5, 4, 2] sum- 0
What number will be printed on the console by the code below: numbers [6, 4, 3, 8, 4, 12, 5, 4, 2] sum- 0 for val in numbers: # This will loop through the numbers list sum sum + val if val 3: break print (sum) numbers - [6, 4, 3, 8, 4, 12, 5, 4, 2] Sum 0 for val in numbers: # This will loop through the numbers list if val 3: continue sum sum + val print (sum) What number will be printed on the console by the code below: numbers [6, 4, 3, 8, 4, 12, 5, 4, 2] sum- 0 for val in numbers: # This will loop through the numbers list sum sum + val if val 3: break print (sum) numbers - [6, 4, 3, 8, 4, 12, 5, 4, 2] Sum 0 for val in numbers: # This will loop through the numbers list if val 3: continue sum sum + val print (sum)
Step by Step Solution
There are 3 Steps involved in it
code 1 The initializes a list of numbers sets the sum to 0 and then loops through ... View full answer
Get step-by-step solutions from verified subject matter experts
