Given the following code, what would the output on the final line be? # implementing Queue using List: q=[] q.append(10) q.append(100) q.append(1000) q.append(10000) print("Initial Queue is:",q) print(q.pop(0)) print(q.pop(0)) print(q.pop(0)) print("After Removing elements:",q) (1 point) Responses [] [] [10,100,1000,10000] [10,100,1000,10000] [10] [10] [10000]
3 answers
The output on the final line would be: [10000]
How could the following code be adapted for a baseball score keeping? 1 def scoreUpdate(value): 2 # update the score value with the points earned 3 return(value + 6) 4 def bonus(value): 5 return(value + 1) 6 score = 6 7 score = scoreUpdate(score) 8 print("after update " + str(score)) 9 score = bonus(score) 10 print("after bonus "+ str(score)) (1 point) Responses Replace the 1 with a 2 in line 5. Replace the 1 with a 2 in line 5. Replace 6 with 1 in line 3 and remove the bonus section. Replace 6 with 1 in line 3 and remove the bonus section. Change the 6 to a 1 in line 6. Change the 6 to a 1 in line 6. Change line 7 to call bonus instead.
Change line 7 to call bonus instead.