I have an array in a sub program and I want to re-use that data in a new subprogram. how would I do this?
I have heard about using a dictionary but i am not sure about how to proceed on doing so. The simpler the code the better, thank you.
def optiona():
playernames = ['A', 'B', 'C', 'D', 'E', 'F']
numjudges = 5
playerscores = []
scoresfile = open('scores.txt', 'w')
for players in playernames:
string = []
for z in range(5):
print("Enter score from Judge", z+1, "for Couple ", players, "in round 1:")
data = input()
playerscores.append(int(data))
string.append(data)
scoresfile.write(','.join(string) + '\n')
print()
print('Registration complete for round 1')
scoresfile.close()
round2()
def round2(playerscores):
print(playerscores)
now after this, i get this error TypeError: round2() missing 1 required positional argument: 'playerscores'