Skip to content

Instantly share code, notes, and snippets.

@bharathmuddada
Created May 29, 2021 04:11
Show Gist options
  • Select an option

  • Save bharathmuddada/02204fea7ae79727f5101dcf3bf020b3 to your computer and use it in GitHub Desktop.

Select an option

Save bharathmuddada/02204fea7ae79727f5101dcf3bf020b3 to your computer and use it in GitHub Desktop.
Largest Element in list Python
l=[10,5,28,6,35]
def getmax(l):
for i in l:
for j in l:
if j > i:
break
else:
return i
return None
print(getmax(l))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment