Skip to content

Instantly share code, notes, and snippets.

@Cam1337
Created April 29, 2010 02:00
Show Gist options
  • Save Cam1337/383020 to your computer and use it in GitHub Desktop.
Save Cam1337/383020 to your computer and use it in GitHub Desktop.
#This was written directly into git. No testing;
equation=raw_input("What is your equation (please use x as a variable): ")
lookfor=raw_input("Factor Number (leave blank for 0): ")
for x in range(1000):
equation=equation.replace("^","**")
answer=eval(equation)
if answer==lookfor:
print "The answer was %s" % x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment