May-13-2022, 08:19 PM
When i run this,
import csv
def main():
with open("battle_royale.csv") as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
print(row)
print ("Battle Royale Tournament Registration")
options = input("Please enter your option using these keys. A: find pre-registered player , B: Find player number, C: Print player lists, Q: Quit program")
if(options == "A"):
preRegist = input("Type in what player you would like to choose.")
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
for item in row:
if input == row(1)
print("You chose," + (preRegist))
print("You chose," + (preRegist))
elif(options == "B"):
playerNum = input("Type your player number.") if(options == "Q"):
print("Goodbye.")
if(options == "C"):
print("See the list of players above.")
main()
I get the error
File "main.py", line 16
if input == row(1)
^
SyntaxError: invalid syntax
Ive tried fixing the indentation, but it doesn't seem to be a indentation issue.
What am I doing wrong?
edit : added screenshot with original indentation, since it removed it when posting[attachment=1740][attachment=1740][attachment=1740][attachment=1740]
import csv
def main():
with open("battle_royale.csv") as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
print(row)
print ("Battle Royale Tournament Registration")
options = input("Please enter your option using these keys. A: find pre-registered player , B: Find player number, C: Print player lists, Q: Quit program")
if(options == "A"):
preRegist = input("Type in what player you would like to choose.")
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
for item in row:
if input == row(1)
print("You chose," + (preRegist))
print("You chose," + (preRegist))
elif(options == "B"):
playerNum = input("Type your player number.") if(options == "Q"):
print("Goodbye.")
if(options == "C"):
print("See the list of players above.")
main()
I get the error
File "main.py", line 16
if input == row(1)
^
SyntaxError: invalid syntax
Ive tried fixing the indentation, but it doesn't seem to be a indentation issue.
What am I doing wrong?
edit : added screenshot with original indentation, since it removed it when posting[attachment=1740][attachment=1740][attachment=1740][attachment=1740]