Computer Science, asked by anindyaadhikari13, 1 month ago

\texttt{\textsf{\large{\underline{Python storms!}}}}

Predict the output of this cøde. Explain your answer.

a = [8, 0, 4, 6, 1]
print(a.clear() == None)


\texttt{\textsf{\large{\underline{Options}:}}}

• True
• False
• Error
• Can't be determined.

Answers

Answered by HarishAS
2

Answer:

The output of this cøde will be True.

Explanation:

<list>.clear( ) method removes all the elements of the list and does not return any value.

So when we print it returns None.

NOTE: Only works for Python 3.3 and above versions

>>> print( a.clear( ) )

None

>>> print(a.clear( ) == None )

True

>>> print(a)

[ ]

I hope this helps : )

Answered by MalayaDhal
0

The O.u.t.p.u.t of this c.o.d.e will be TRUE

Similar questions