Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created October 23, 2019 18:56
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 codecademydev/204c6a3678f5cd1b5438c7474025415d to your computer and use it in GitHub Desktop.
Save codecademydev/204c6a3678f5cd1b5438c7474025415d to your computer and use it in GitHub Desktop.
Codecademy export
def max_num(lst):
biggest_number = 0
for nums in lst:
if lst.index(nums) == 0:
biggest_number = nums
elif nums >= biggest_number:
biggest_number = nums
return biggest_number
print(max_num([50, -10, 0, 75, 75, 20]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment