>>107830158
well for example lets say you wanted to iterate over all the numbers in between 0 and x^y, and that x and y are integers.
in python you would do
for i in range(0, x**y)
First, you can't do x**y. That function doesn't exist. Instead you have to do pow(x, y), which takes two decimals as the input, so you would have to do
pow(Decimal(x), Decimal(y))
and that returns a decimal, which you can't cast into an integer, even though both of the inputs are integers. Also, you can't iterate through a range of two different types, so since 0 is an int, and x^y is a decimal, you have to either cast 0 as a decimal (which means you won't be able to index arrays with it), or you can do:
for i in 0...Int(NSDecimalNumber(pow(Decimal(x), Decimal(y)))
NSDecimalNumber is a deprecated type you shouldn't use, because it relies on some old objective C frameworks which are bundled with the standard swift library. You can't convert a Decimal into an integer, but you can convert NSDecimalNumber.
I spent 8 minutes in a coding interview shitting myself trying to figure out how to turn this stupid exponent into an integer.