-2

The program runs and informs the user about the kind of the equation. So I want this to appear:

"This is a: ax2+ bx + c"

How can I do this in pycharm or any other IDE?

Cœur
  • 37,241
  • 25
  • 195
  • 267
DimiDak
  • 4,820
  • 2
  • 26
  • 32
  • Well? Can you share it? – DimiDak Oct 24 '17 at 23:06
  • This is possible to do. It requires quite a lot of time and effort. Professional solutions exist in the form of CAS (computer algebra systems), and they're quite expensive. If you want to recreate something like that, you'll need to really dig into how you want to approach this, which makes this entirely too broad for Stack Overflow. – Makoto Oct 25 '17 at 23:41

1 Answers1

2

I'm guessing what you want is to show an exponent in the stdout of your Python program. I've checked in PyCharm, and the following works for me:

print(u'This is a: ax\u00B2+ bx + c')

You can read more about how this works here. I've tried to figure out how to cleanly do string formatting in case you want to support a number of different possible exponents, and I've found it non-trivial. If someone else knows how to do this, it would make a useful addition/edit to this answer, or alternative answer.

Max von Hippel
  • 2,856
  • 3
  • 29
  • 46
  • Thanx a lot man! This did the trick. Ιn contrast with the other smart asses downvoting and showing off their wisdom, someone just helped. – DimiDak Oct 26 '17 at 10:03
  • @DimiDak the other people were right that your question needed to be edited for clarity. You should read the Stack Overflow documentation to help you write better questions in the future. That said, I'm glad I could help. If this answer solved your problem, please mark it as correct by clicking the green check mark. – Max von Hippel Oct 26 '17 at 16:26
  • 1
    It was a hard question to describe. Also the smart guy whose "quick google search turned up the answer easily" could then just share it. – DimiDak Oct 26 '17 at 20:14
  • I agree with that. – Max von Hippel Oct 26 '17 at 20:29