Reputation: 1399
How can I make this python code:
# -*- coding: cp1252 -*-
a=4
b=2
c=1.0
d=1.456
print '%fx³ + %fx² + %fx + %f = 0' %(a,b,c,d)
print like this:
4x³ + 2x² + 1x + 1.456 = 0
instead of like this (how it prints currently):
4.000000x³ + 2.000000x² + 1.0000000x + 1.456000 = 0
Upvotes: 4
Views: 11974