Question: 6. This program is supposed to convert everything in a list to integers and then calculate their sum. It should print 6 because 1 +

 6. This program is supposed to convert everything in a list

6. This program is supposed to convert everything in a list to integers and then calculate their sum. It should print 6 because 1 + 2 + 3 is 6. Fix the program. input = ['1', '2', '3'] for string in input: numbers = [] numbers.append(int(string)) result = 0 for n in numbers: result + n print("their sum is", result) 7. This program is supposed to print (1, 2, 3). Fix it. numbers = ['1', '2', '3'] for number in numbers: number = int(number) print(numbers)

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!