Q:

Why do i get SyntaxError: unexpected EOF while parsing when i run this code?

    s = input(' Enter a monomial: ')
    coeff, power = s.partition('x^')
    print('{}x^{}'.format(int(coeff) * int(power), int(power) - 1)

I do not know what else is needed at the end of this code. Is there something that needs to be added in?

A:

It's because you're not closing print function, one a close parenthesis at the end is missing. I suggest you to use some linter to debug and find warning and errors. The final code should be as below:
s = input(' Enter a monomial: ')
coeff, power = s.partition('x^')
print('{}x^{}'.format(int(coeff) * int(power), int(power) - 1))

