I need to get a list of powers from an expression, for example:
'2 * x ** 3 + x ** -1 + x**4'
the expected result is
[3, -1, 4]
I have no idea how to do this, hence I cannot include any attempts what what I have tried.
I will be so grateful for any advice