Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3348976
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:36:29+00:00 2026-05-18T01:36:29+00:00

I am trying to make a search function to work with algebra problems. I

  • 0

I am trying to make a search function to work with algebra problems. I want something like Wolfram Alpha but I am building a python framework for it. It should be able to figure out multiple variables and equations on both sides of the equal sign. I have recently asked about a validator for the program so I need a loop that goes through a bunch of numbers and figures out what each of the variables equals. My problem is the decimals. I suggest using a search function. Here is the equation solver:

def s_equation(a):
   left, right = a.split('=')
   return eval(left) == eval(right)

Any help is helpful!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:36:30+00:00Added an answer on May 18, 2026 at 1:36 am

    The eval()s won’t work, because left and right are strings, not expressions. Moreover, you’ll have to do substantial validation to make what a user might input a valid Python expression. Consider a few values you might get:

    # The typical person's notation for x-squared isn't valid Python
    x^2 + x - 3
    # 3x means 3 * x to us, but to python it means nothing
    3x + 4
    # Some people use % to represent division, but that's a modulo operator to Python
    3 % 4x
    # Python doesn't understand the distributive property
    3(4 - x)
    # People might use some functions in a way Python doesn't understand
    cos x
    # Square brackets are used synonymously with parentheses
    x[(x^2 - 5)(x^3 - 5x)]
    

    So, in short, you’ll need some kind of engine to convert plain text equations into valid Python expressions. This is no easy task, but it can certainly be done.

    Although your project is very ambitious, I think it’s a great way to use Python! If you come up with an intelligent way to convert equations as strings into valid Python, you should share it immediately because quite a few people in the scientific and math community could have use for that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.