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 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
Get step-by-step solutions from verified subject matter experts
