Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started