Created
October 12, 2023 18:15
-
-
Save narenaryan/0ee0589392edff8d2579b4c107933bfe to your computer and use it in GitHub Desktop.
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
def find_max(arr): | |
max = arr[0] | |
for num in arr: | |
if num > max: | |
max = num | |
return max | |
arr = [5, 10, 3, 8, 15] | |
max_num = find_max(arr) | |
print("Maximum element in the list:", max_num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment