Created
May 29, 2021 04:11
-
-
Save bharathmuddada/02204fea7ae79727f5101dcf3bf020b3 to your computer and use it in GitHub Desktop.
Largest Element in list Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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