Skip to content

Instantly share code, notes, and snippets.

@shamikalashawn
Created February 6, 2017 22:52
Show Gist options
  • Save shamikalashawn/d32ea442742b5a47222e8164186e0c7e to your computer and use it in GitHub Desktop.
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.
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