Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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