Python Forum

Full Version: Calculate using Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I just started my first python course and I'm having a bit of trouble figuring out this calculation. I assume its pretty simple but we didn't go over this in class since we were working on drawing out shapes and what not using the turtle. If anyone could point me in the right direction towards completing this I'd really appreciate it. Thanks!

Calculate 2**0 + 2**1+ 2**2+ 2**3+ ...+2**63

Hint: It is about a geometric progression.
  • create a variable to store the total.
  • Create a loop to go through the required values
  • in the loop add to the total variable the calculation using the looped value.
Study the examples usually given with range()