Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created November 16, 2021 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/663bf3e2858065a74745248444cd8fd4 to your computer and use it in GitHub Desktop.
Save amankharwal/663bf3e2858065a74745248444cd8fd4 to your computer and use it in GitHub Desktop.
def maximum(x):
maximum_index = 0
current_index = 1
while current_index < len(x):
if x[current_index] > x[maximum_index]:
maximum_index = current_index
current_index = current_index + 1
return maximum_index
a = [23, 76, 45, 20, 70, 65, 15, 54]
print(maximum(a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment