L Lan Anh New member Sep 20, 2021 #1 What will be the output of the following Python code? Code: >>> a={5,6,7} >>> sum(a,5) A. 5 B. 23 C. 18 D. Invalid syntax for sum method, too many arguments
What will be the output of the following Python code? Code: >>> a={5,6,7} >>> sum(a,5) A. 5 B. 23 C. 18 D. Invalid syntax for sum method, too many arguments
N Nguyễn Hương Chà New member Sep 20, 2021 #2 Answer: b Explanation: The second parameter is the start value for the sum of elements in set a. Thus, sum(a,5) = 5+(5+6+7)=23. Upvote 0 Downvote
Answer: b Explanation: The second parameter is the start value for the sum of elements in set a. Thus, sum(a,5) = 5+(5+6+7)=23.