Created
February 6, 2017 22:52
-
-
Save shamikalashawn/d32ea442742b5a47222e8164186e0c7e to your computer and use it in GitHub Desktop.
Given a numerical limit, the function returns the highest number cubed that is still less than the limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def highest_number_cubed(limit): | |
answer = 0 | |
for num in range(limit): | |
print (num**3) | |
if num**3 > limit: | |
answer = num - 1 | |
return answer | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment