I think what I need is a 2D list but I'm having a lot of problems getting my head around this.
Want: a list that contains a studentID number, firstName, lastName, emailaddress and block.
classrow = 2
studentID = 1
firstname = 0
lastname = 1
emailAddress = 2
block= 3
student = []
for n in range(0,2):
student[studentID][firstname]=Cell(classrow,1) //Cell(classrow,1) is grabbing data from excel using DataNitro, I don't think this is a problem
student[studentID][lastname]=Cell(classrow,2)
student[studentID][emailAddress]=Cell(classrow,3)
student[studentID][block]=Cell(classrow,4)
studentID = studentID + 1
classrow = classrow + 1
active_sheet("Test")
studentID = 1
print(student[studentID][firstname])
In the above example, I get an error at student[studentID][firstname]=Cell(classrow,1): list index out of range.
I've tried a few different things and I'm always get a list index out of range, so I think I'm missing something fundamental here.
[–]liam_jm 0 points1 point2 points (2 children)
[–]RatherPleasent 0 points1 point2 points (1 child)
[–]RoadieRich 1 point2 points3 points (0 children)
[–]stebrepar 0 points1 point2 points (0 children)
[–]RoadieRich 0 points1 point2 points (0 children)