Ask Your Question
1

EOL error in Sage-9.1

asked 2020-10-01 03:08:30 -0600

saxad gravatar image

updated 2020-10-01 14:54:29 -0600

slelievre gravatar image

I want to modify a Python package for solving 'Quasi normal modes' using SageMath if possible, I want the below error to be fixed.

?qnm.modes_cache

grav_220 = qnm.modes_cache(s=-2, l=2, m=2, n=0)
omega, A, C = grav_220(a=0.68)
print('ω={}, A={}'.format(omega, A))
print('C={}''.format(C))

I get the error for the second input as

File "<ipython-input-13-1f77b2f8a4ef>", line 4
print('C={}''.format(C))
                        ^
SyntaxError: EOL while scanning string literal
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2020-10-01 10:46:48 -0600

slelievre gravatar image

The error message suggests a string is opened but never closed.

Indeed, looking at the code, one of the strings' closing delimiter is doubled.

This must be a typo: the opening string delimiter is a single quote ' but the closing string delimiter is two single quotes ''.

That does not work.

Solution: replace

print('C={}''.format(C))

with

print('C={}'.format(C))
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-10-01 03:08:30 -0600

Seen: 43 times

Last updated: Oct 01