Skip to content

Instantly share code, notes, and snippets.

@erkobridee
Created February 3, 2012 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erkobridee/1729979 to your computer and use it in GitHub Desktop.
Save erkobridee/1729979 to your computer and use it in GitHub Desktop.
um dos desafios do site rankk.org
'''
Really elementary
A box contains some buttons.
1/4 of them are black,
1/8 of them are red,
and the rest are white.
There are 636 more white buttons than red buttons.
How many buttons are there altogether?
moreThan = 636
black = 25%
red = 12.5%
white = 12.5% + moreThan
x = 0.25x + 0.125x + 0.125x + moreThan
x - 0.50x = moreThan
0.50x = moreThan
x = moreThan/0.50
'''
def mathElementary(moreThan):
return moreThan/0.50
print mathElementary(636)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment