Powering x until reach y in while loop
<p>Hi I want to make an app that will be raise X to a power until it reaches Y.</p>

<p>I have for now something like this</p>

<pre><code>x = 10 
y = 1000000
while x &lt;= y: 
    x = x**x
print(x)
</code></pre>

<p>I don't want it in function.</p>

<p>I know that probably this is simple, but I just started learning Python :)</p>

<p>10<sup>10<sup>10<sup>â¦</sup></sup></sup> (x) will never be equal to 10<sup>6</sup> (y) because 10<sup>10</sup> is four orders of magnitude larger. Your program will interpret x = 10 as less than 10<sup>6</sup>, execute x<sup>x</sup> (10<sup>10</sup>), interpret this value as greater than 10<sup>6</sup>, exit the loop, and print x (now 10<sup>10</sup>).</p>

<p>I don't think this is what you're trying to do; please consider the comments other users have left. I have a hunch you're looking for x<sup>n</sup>=y (10 * 10 * 10 â¦), for which you could simply use logarithms.</p>

python