Python Homework Help: For Any Assignment Related Queries, Call Us At: - You Can Mail Us At: - or Reach Us At
Python Homework Help: For Any Assignment Related Queries, Call Us At: - You Can Mail Us At: - or Reach Us At
Hint: You will need to store two variables in this function: the biggest number
you've seen so far (remember to initially set this to 0), and its position. Then
iterate over the list, and for each element, check if it's bigger than the biggest
number you've seen so far. If it is, change both variables (remember to
change BOTH)!
So in your main program, you'll have to keep calling this function (in a loop)
until the list is empty and keep printing the number that is returned.
Write a program where the user can enter each of his grades, after which the program
prints out a report card with GPA. Remember to ask the user how many classes he took.
Example output is below.
def find_largest(L):
maximum = 0
index = 0
for i in range(len(L)):
if L[i] > maximum:
maximum = L[i]
index = i
del L[index]
return maximum
# use float(...)