Post

@PythonPr Supposed to be an error,
Nonetheless the answer is supposed to be 6
Why is it 6?
Here's the breakdown;
You are creating a list named x that contains three integer elements.sum(x): The sum() function is a built-in Python utility that iterates through an iterable
English

@PythonPr Error
courtesy of unclosed parenthesis in the print statement
English

@PythonPr Ans--->(C)Error
There’s a missing closing parenthesis ) in the print statement, so Python raises a SyntaxError
English

@PythonPr Answer: A) 6
sum() adds all numbers in a list:
› sum([1, 2, 3])
› 1 + 2 + 3 = 6
For beginners: sum() works on any iterable of numbers. Can also set start: sum([1,2, 3], 10) = 16
English

@PythonPr Output C) Error ✅
Because the code is missing a closing parenthesis:
print(sum(x) ➜ should be print(sum(x))
So it throws: SyntaxError: '(' was never closed
English

@PythonPr B) 6 is the right answer.
Just use the sum function here and simply add of all the numbers present in list.
English

@PythonPr 1. The print statement is missing a closing parentheses therefore a SyntaxError results
2. Barring that the result would be 6
English

@PythonPr Code will throw an error as closing bracket ')' is missing in the print statement.
English

@PythonPr The answer is A.
sum() takes all numbers within the list, then adds them together.
English

@PythonPr error.
Missing closing parenthesis at print....
The print function should be closed print()
English

@PythonPr This happens to me all the time when vscode forgets to do the work for me haha.
Its an syntax error, missing parentheses lol
English

@PythonPr Interpreter told me 6 . Because I had no idea it could do that :)
English

@PythonPr Error, print statement is not closed
print (sum(x)
Should have been
print (sum(x))
English
























