Skip to content

Commit

Permalink
Minor grammar improvements to python/grains/mentoring.md (#2351)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasantony12 authored Sep 8, 2024
1 parent 8bc4e26 commit 49b9ac2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tracks/python/exercises/grains/mentoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def square(number):
"""Return the number of grains on a given square number.
:param number: int - square number on which we want to calculate the amount of grains.
:return: int - amount of grains present on the give square number(number).
:return: int - the amount of grains present on the given square number(number).
"""
if number < 1 or number > 64:
raise ValueError("square must be between 1 and 64")
Expand All @@ -38,7 +38,7 @@ def total():
### `square(number)`

As we did `2**(number - 1)` on block one there will be only 1 grain, 2 to the power of 0 equals 1.
On block 2 there will 2 and on block 3 there will be 4 which is equal to 2 to the power of 1, and 2 to the power of 2, respectively.
On block 2 there will be 2 and on block 3 there will be 4 which is equal to 2 to the power of 1, and 2 to the power of 2, respectively.
Hence generalized, **2 to the power of (number-1)**.

### `total()`
Expand Down

0 comments on commit 49b9ac2

Please sign in to comment.