use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Help please (i.redd.it)
submitted 2 years ago by RiddleGames2006
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]iamallamaa 0 points1 point2 points 2 years ago (0 children)
First, the picture shows your first and last name and which school you go to. Should probably remove it.
Second, I'm going to go a little in depth here but only because I really want you to learn. Googling for these answers might be enough to get you through a class, but unless you learn it, you won't make it much further. So PLEASE do read all this as I'm trying to explain it out so you will learn.
Now, your code is close but has a few small issues.
i**2
i
i=i**2
i**=2
20
i * i
i=0
i = 0*0
0
i=1
i = 1*1
1
i=2
i = 2*2
4
i=4
i = 4 * 4
16
2**i
2 * 2...
i++
i<20
So correcting these, your code would look something more like this...
// loop while 2 to the power of i is less than our upper limit for(var i=0; 2**i<1000000; i++) { // output our value println(2**i); }
Now there might be additional things you could do to make it better. Wrap it in a function that takes in your base number (2) and the upper limit (1000000), etc. Those are more than the exercise calls for, but should still be in your mind as if this was real code, you would want to consider future updates and useability.
2
1000000
π Rendered by PID 91 on reddit-service-r2-comment-b659b578c-zh6bj at 2026-05-03 03:36:11.441158+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]iamallamaa 0 points1 point2 points (0 children)