Python Forum
SyntaxError: invalid syntax - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: SyntaxError: invalid syntax (/thread-8322.html)



SyntaxError: invalid syntax - sivaranganathch - Feb-14-2018

Hi Group,

I am blocked with error while i am writing program using find command.

Prg:
str = "geeksforgeeks is for geeks"
str2 = "geeks"

# using find() to find first occurrence of str2
# returns 8
print ("The first occurrence of str2 is at : ", end="")
print (str.find( str2, 4) ).

Error after compilation .

File "jdoodle.py", line 8
print ("The first occurrence of str2 is at : ", end="")
^
SyntaxError: invalid syntax
Command exited with non-zero status 1



RE: SyntaxError: invalid syntax - metulburr - Feb-14-2018

Quote:
print (str.find( str2, 4) ).
is the last period in your code?