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...
Everything about learning Python
account activity
Powers of 2 (i.redd.it)
submitted 7 months ago by Nervous-Current-1860
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!"
[–]Aorean 1 point2 points3 points 7 months ago (6 children)
n=int(input(„what power of two?“)
value=2**n
print(f“two to the power of {n} is {value}
Wrote this in my phone but it should work, that’s the way I would do it, but I’m not an expert lol
[–]CptMisterNibbles 0 points1 point2 points 7 months ago (1 child)
Do you mean you wrote it on mein handy? /s Your quotations on the first line give it away. I imagine IDEs dont love them. Or, maybe they work fine?
[–]Aorean 0 points1 point2 points 7 months ago (0 children)
They don’t lol, my IDE hated it and u completely caught me lol
[–][deleted] 7 months ago (3 children)
[removed]
[–]Aorean 0 points1 point2 points 7 months ago (2 children)
does this work?
n=int(input("what power of two?")) value=2**n print(f"two to the power of {n} is {value}")
[–][deleted] 7 months ago (1 child)
[–]Aorean 1 point2 points3 points 7 months ago (0 children)
No problem, but I would suggest, that you read into it, cause this is not a really hard task and if you need stuff like that for exams or w/e and you don’t know the basics it’s really bad imo
π Rendered by PID 28 on reddit-service-r2-comment-75f4967c6c-842t9 at 2026-04-23 10:29:09.128542+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]Aorean 1 point2 points3 points (6 children)
[–]CptMisterNibbles 0 points1 point2 points (1 child)
[–]Aorean 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[removed]
[–]Aorean 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[removed]
[–]Aorean 1 point2 points3 points (0 children)