Is there any way in Python to give the opposite of each numeral element of a list in one line, without doing, for example:
list_ = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for x in range(len(list_)):
list_[x] = -list_[x]
In this case, considering the list
[0, 1, 2, 3..., 9]
the output should be
[0, -1, -2, -3..., -9]
Every number of the list should be its opposite.
I tried -list_ but it didn't work.
I searched but I found only how to reverse a list, and not how to oppose its elements (I hope this is the correct word, meaning that each number should end up being its opposite.)
I know that I can use a list comprehension, but I was wondering if there was a special keyword in Python to achieve that.