How do I change my code to use arrays?
<p>This is my code so far. I can get my code to prompt the user to input 4 test scores. I have made it so it asks "Enter the score for test number N:" </p>

<p>My problem lies in being able to extract the input values from what the user would input. My end goal is to be able to drop the lowest test grade and calculate an average with the remaining scores. Input data used would be 99, 99, 99 and 77. </p>

<p>I have an example that takes the min from a variable that is assigned X numbers but not from when you would get it from a user input. </p>

<pre><code>def main():
    scores = getNumbers()

def getNumbers():
    testCountIs = 0
    testNum = 4
    totalScore = 0

    for test in range(1, testNum+1):
        print('Enter the score for test number', int(testCountIs+1), end='')
        testScores = int(input(': '))
        testCountIs += 1

main()
</code></pre>

<p>Edit2: below is the code that works for this program.</p>

<pre><code>    def main():
        scores = getNumbers()
        print("The average with the lowest score dropped is: ",float(sum(scores))/len(scores))

    def getNumbers():
        scores=[]
        for testNum in range(4):
           print('Enter the score for test number',int(testNum+1),end='')
           scores.append(int(input(': ')))
        scores=[score for score in scores if min(scores)!=score]
        return scores

    main()
</code></pre>

<p>Your code was close. Just need to define a list, append to it, then return it </p>

<pre><code>scores = [] 
for test in range(testNum):
    print('Enter the score for test number', int(test + 1), end='')
    score =  int(input(': ')
    scores.append(score) 
return scores 
</code></pre>

<p>You should calculate the minimum, drop it, and find the average outside of this function </p>

python arrays