Skip to content

Instantly share code, notes, and snippets.

@simplyluke
Last active January 3, 2016 01:59
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 simplyluke/8392811 to your computer and use it in GitHub Desktop.
Save simplyluke/8392811 to your computer and use it in GitHub Desktop.
the bridge problem
def higher(x):
a = (x-252.0)**2.0
b = a/(-824.0)
return b + 136 - 59
def lower(x):
a = (x-252.0)**2.0
b = a/(-538.1695)
return b + 118 - 59
dist = [252, 202, 152, 52]
for x in dist:
print("The higher bridge at " + str(x) + " meters is " + str(higher(x)) + " meters high")
print("The lower bridge at " + str(x) + " meters is " + str(lower(x)) + " meters high")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment