Python Forum
Python 3.7, Windows 7, Syntax Error - 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: Python 3.7, Windows 7, Syntax Error (/thread-25191.html)



Python 3.7, Windows 7, Syntax Error - hughdent - Mar-23-2020

I'm working from Python Projects for Beginners by Connor P. Milliken
I have check and rechecked over and over to make sure I have entered the code exactly as the example in the book but I cannot overcome this error?


# print company information first, using format
print( "\t\t{ }".format( company_name.title( ))   
print( "\t\t{ }".format(company_address) )  this is line 19
print( "\t\t{ }".format( company_city ) )
Error:
File "<ipython-input-138-4d7e4480253e>", line 19 print( "\t\t{ }".format(company_address) ) ^ SyntaxError: invalid syntax



RE: Python 3.7, Windows 7, Syntax Error - buran - Mar-23-2020

you have artifact this is line 19 at the end of the previous line. Either remove it or comment it out if you want to keep it for whatever reason
Also on the firs line you are missing one closing bracket

print( "\t\t{ }".format(company_name.title( )))
print( "\t\t{ }".format(company_address))
print( "\t\t{ }".format(company_city))