why does variable instantation contain syntax error?

Question:

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..

Asked By: Pieter De Vleugel

||

Answers:

I think the =^ operator doesn’t exist, the code lacks indentation and commas between arguments you pass inside connect() call

Answered By: rotimislaw
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.