subject

1| my2DTuple = ((1, 2, 3), 2| (4, 5, 6), 3| (7, 8, 9)) 4| 5| sum = 0 6| for aTuple in my2DTuple: 7| for num in aTuple: 8| sum += num 9| print(sum) The code above adds up every integer in the 2D tuple my2DTuple. The goal is for it to print sum once at the end, once all the numbers have been added. Right now, however, it's printing sum after each individual number is added. sum is calculated correctly, but it is printed at every step along the way. How would we change this code so that sum prints only once, after all the numbers have been added? Select all the changes we would need to make.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Is the following sentence true or false? during meiosis, the two alleles for each gene stay together.
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
You know the right answer?
1| my2DTuple = ((1, 2, 3), 2| (4, 5, 6), 3| (7, 8, 9)) 4| 5| sum = 0 6| for aTuple in my2DTuple: 7|...
Questions
question
Mathematics, 18.03.2021 02:20
question
Mathematics, 18.03.2021 02:20
question
Business, 18.03.2021 02:20
question
Mathematics, 18.03.2021 02:20
Questions on the website: 13722363