- Weekly Challenge #8

This week’s challenge is brought to you by the guys over at !


You are to take a alegebraic equation input from the user. Here, you can either take only the coefficients of the terms as input or the entire equation and then solve it!

(YES, write a program to do your homework)

And as for the equation, it should be able to solve up to 2nd degree equations. Any higher than that is entirely up to you! A sample is given below.

User input : (x ** 2) - 6x + 8 = 0

Output : x = [2, 4]

NOTE : You can give the output in any readable form that you prefer. The variable in the user entered equation will always be x unless you decide to only take the coefficients for the input, in which case, it is in your hands.

And as usual, it should all have proper prompts and human readable interactions.


For submitting your repls, post them on the repl talk share board and ensure that they contain #WEEKLY in their name.

NOTE : You cannot have multiple weekly challenge submissions but if you want to share multiple ways of achieving the goal, you can make regular posts that don’t contain #WEEKLY in their name, even WEEKLY is fine.

And that’s it for today, code away and have fun replers!

That’s the prompt! What do you guys think? Sounds like fun. As always, feel free to post your solutions down below (and of course, if you are up to it, share them at as well :+1:) Here is some Q&A from the original post that clarifies some things:

AmazingMech2418 (646)](

Should it also be able to get any solutions with complex numbers? Also, should it support the methods of notating exponents as ^ and ** or just ** ? Also, should it include trigonometry, exponential functions, logarithms, and rational functions or just linear and quadratic functions?

TheDrone7 (984)

  1. Complex numbers are optional.
  2. It’s up to you but by default I am going to assume it to be ** so you would need to specify if you want me to type in some other format.
  3. Only linear and quadratic functions are required. Others can be added for bonus but won’t account to your actual score.

Coder100 (2653)](
POG so by equations, you mean:

- a * (x ** 2) + bx + c = 0
- ax + c = 0



1 Like