Python Terminal unexpected character after line continuation character -


i have file isqrt.py, containing following code:

    cmath import sqrt     x = -1     y = sqrt(x)     print(y) 

i getting following error in mac terminal:

file "isqrt.py", line 1 {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210                                                   ^ syntaxerror: unexpected character after line continuation character 

do know causing error?

your error showing file you're running not think is; it's got whole load of control characters. seems you've saved file rtf rather plain text. ideally, should use proper text editor write python code.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -