exponent

How would I raise integers in a list to successive powers? (python)

How would I raise integers in a list to successive powers? (python) Question: Beginner here. I want to raise elements(integers) in the list to the power of x+1, but am stuck. For example: Lst = [a, b, c, d, e] a^x, b^(x+1), c^(new x + 1), d^(new x + 1), and so forth.. Another example: …

Total answers: 2

How to sort this list to make the exponent value go first?

How to sort this list to make the exponent value go first? Question: Given list = [10, ‘3 ^ 2’, ‘2 ^ 3’], how to sort the list to make the exponents values ( ‘3 ^ 2’ and 2 ^ 3 ) are before any integer / float value and exponent values are sorted from …

Total answers: 1

Why does python add an 'L' on the end of the result of large exponents?

Why does python add an 'L' on the end of the result of large exponents? Question: If you’ve noticed, python adds an L on to the end of large exponent results like this: >>> 25 ** 25 88817841970012523233890533447265625L After doing some tests, I found that any number below 10 doesn’t include the L. For example: …

Total answers: 1

Python and Powers Math

Python and Powers Math Question: I’ve been learning Python but I’m a little confused. Online instructors tell me to use the operator ** as opposed to ^ when I’m trying to raise to a certain number. Example: print 8^3 Gives an output of 11. But what I’m look for (I’m told) is more akin to: …

Total answers: 3

Numpy matrix power/exponent with modulo?

Numpy matrix power/exponent with modulo? Question: Is it possible to use numpy’s linalg.matrix_power with a modulo so the elements don’t grow larger than a certain value? Asked By: John Smith || Source Answers: What’s wrong with the obvious approach? E.g. import numpy as np x = np.arange(100).reshape(10,10) y = np.linalg.matrix_power(x, 2) % 50 Answered By: …

Total answers: 5