Skip to content

Instantly share code, notes, and snippets.

@narenaryan
Created October 12, 2023 18:15
Show Gist options
  • Save narenaryan/0ee0589392edff8d2579b4c107933bfe to your computer and use it in GitHub Desktop.
Save narenaryan/0ee0589392edff8d2579b4c107933bfe to your computer and use it in GitHub Desktop.
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