I'm trying to build some SQL INSERT commands using data from arrays.
My problem is, I can't figure out how to iterate through all of them at the same time.
Here is my beginning code:
import os
raceValues = [
"Human",
"Elf",
"Orc"
]
classValues = [
"Fighter",
"Mage",
"Cleric"
]
alignmentValues = [
"Good",
"Neutral",
"Evil"
]
for x in insertValues:
characterData = """INSERT INTO game.Characters(race, class, alignment)
VALUES '{raceValues}', '{classValues}', '{alignmentValues}' """
for command in characterData.splitlines():
command = command.format(**data)
print(command)
So for the above, I'm trying to get 3 INSERT statements using the data from the 3 arrays I defined.
Is there a way to do this in Python 3?
Thanks!