Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated mentoring.md of grains #2351

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading