Hey everybody. All my Google searches for help led me here so I thought I'd post my actual problem directly. I'm in a 101 programming course and this is only our second Python assignment. What I need to do is use one-dimensional parallel arrays to allow input of four different grades for a single student. I know that I need to use multiple arrays, ex: grade1, grade2, etc., but I'm not sure of what subscript to use or how to implement the arrays into the code. Our text doesn't go over the use of more than two one-dimensional arrays and we're not allowed to use two-dimensional arrays.
Edit: The code I came up with is below but instead of just inputting a single grade into each array, it makes me input four different grades, four different times.
stdtn = (input("Enter the student's name. Enter Q to quit.")) while stdtn != "Q": stdts[count] = stdtn assgn = 1 while assgn < 5: grade1[count] = int(input("Enter the grade for assignment 1.")) grade2[count] = int(input("Enter the grade for assignment 2.")) grade3[count] = int(input("Enter the grade for assignment 3.")) grade4[count] = int(input("Enter the grade for assignment 4.")) assgn = assgn + 1 count = count + 1 stdtn = input("Enter the next student's name. Enter Q to quit.") T = 0
Any help or pointing-in-the-right-direction would be very appreciated.
Edited 5 Years Ago by TJones: n/a