Hi I am a beginner in Python, and I am trying to make a function which shows me the largest element in the list. Where I am going wrong?
l = [2,6,9,7,41,4]
def getmax(l):
assume = l[0]
for i in range(1,len(l)):
if l[0] > l[i]:
assume = l[0]
else:
assume = l[i]
return assume
print(getmax(l))