Answered step by step
Verified Expert Solution
Link Copied!

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 +

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

6. Discuss staff scheduling on a patient care unit.

Answered: 1 week ago