Q:

Output is: a=[1,2,3,4] b=[sum(a[0:x+1]) for x in range(0,len(a))] print(b)

1

Output is

a=[1,2,3,4]
b=[sum(a[0:x+1]) for x in range(0,len(a))]

print(b)

  1. 10
  2. [1,3,4]
  3. 4
  4. [1,3,6,10]

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Correct Answer:

[1,3,6,10]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python Multiple Choice Questions And Answers

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Which of the following data type use Key:pair... >>
<< Guess the output: a=[14,52,7] b=a.copy() b is a...