Python Forum

Full Version: Python 3.7, Windows 7, Syntax Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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))