I’m learning python. It gives syntax error in this script. I’m unable to figure out.
conn = psycopg2.connect(
host = str(Ip)
user = "test"
password="test1234")
the error:
user^= "test"
^
SyntaxError: invalid syntax
There is something wrong with the user variable instantiation according to the compiler.. I have no knowledge of how to solve this..
>Solution :
I think the =^ operator doesn’t exist, the code lacks indentation and commas between arguments you pass inside connect() call