Flipping the boolean values in a list Python

python

Solution

It's easy with list comprehension:

mylist  = [True , True, False]

[not elem for elem in mylist]

yields

[False, False, True]

Problem

I have a boolean list in Python ``` mylist = [True , True, False,...] ``` which I want to change to the logical opposite `[False, False, True , ...]` Is there an inbuilt way to do this in Python (something like a call `not(mylist)` ) without a hand-written loop to reverse the elements?

Original source