225k views
25 votes
What will be printed to the screen when the following program is run?

What will be printed to the screen when the following program is run?-example-1
User MohsenB
by
5.2k points

2 Answers

5 votes

Answer:

It will print 20, because you are adding all the values of your list together using the max function, and then adding the actual integers in your list together with the previous number.

User Thomas Fournet
by
4.8k points
8 votes

Answer:

20

Step-by-step explanation:

max(my_list) is 5 (finds the maximum value)

sum(my_list) is 1 + 2 + 3 + 4 + 5 = 15 (finds the sum of values)

=> max(my_list) + sum(my_list) = 5 + 15 = 20

User Jubin Patel
by
4.7k points