Inserting loop result into graphql - Python

Hi, I am new to coding and was wondering how to get the result of my loop,. Giving a specific address each time, into the ‘is’ section of my query so that it loops through all the addresses. Any help is appreciated.

pairs = pd.read_csv(‘JustPairs.csv’, header=None)
for i in pairs:
print(i)

query = """
query MyQuery )
    smartContractEvents(
      smartContractAddress: {is:"""print(i)"""}
      smartContractEvent: {is: "Mint"}
      options: {desc: "block.height", limit: 10}
    ) {
      block {
        height
      }
      arguments {
        value
        argument
      }
      smartContract {
        currency {
          symbol
        }
      }
    }
  }
}

Hey @Ben_Mcdermott,

Are you running the Python in an execute node or wanting to call n8n from an external Python script to work on the data?