-3
a = [0,0,0]
Print (not a)

Output:

False

I don't get it.it's actually >"true" right?.I'm sorry,I'm new to coding.

1 Answers1

0

See, if the list is empty ,then you will get a True result.

In [1]: a=[]

In [2]: not a
Out[2]: True

So, when you are trying to perform operation on a list object, it will check if the list is None or not and then give the result.

In [3]: a=[0]

In [4]: not a
Out[4]: False

This will return False because list is not empty. You should read more on python docs or learn from some tutorials. There are plenty available online.

Anurag Reddy
  • 1,159
  • 11
  • 19