MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codehs/comments/szr0lz/need_help_with_476_powers_of_two_python/
r/codehs • u/Raeyzn • Feb 23 '22
9 comments sorted by
1
I’ve been stuck on this problem for quite some time. I’m new to python. Help would be appreciated. Thx
3
The assignment gives you a hint to only run your loop 20 times, so do 'range(0,20)' instead of going all the way to a million. then inside the loop, do the operator 2 raised to the power of i. The power operator is ** not .
I know it’s late, but I got
power = 1
for i in range(24):
print(power) power *= 2
0
[deleted] — view deleted comment
2 u/Master-Pollution-648 Nov 09 '22 🥰
2
🥰
[removed] — view removed comment
1 u/Raeyzn Feb 24 '22 Thanks so much, yeah I understand it now. Good insight
Thanks so much, yeah I understand it now. Good insight
1
u/Raeyzn Feb 23 '22
I’ve been stuck on this problem for quite some time. I’m new to python. Help would be appreciated. Thx
3
u/5oco Feb 24 '22
The assignment gives you a hint to only run your loop 20 times, so do 'range(0,20)' instead of going all the way to a million. then inside the loop, do the operator 2 raised to the power of i. The power operator is ** not .
1
u/Impossible_Loquat697 Dec 10 '25
I know it’s late, but I got
power = 1
for i in range(24):
0
u/[deleted] Feb 27 '22
[deleted] — view deleted comment
2
u/[deleted] Feb 24 '22
[removed] — view removed comment