Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created August 7, 2020 18:07
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/b150f5fa5da5f5c852fcb09c4e27a5ea to your computer and use it in GitHub Desktop.
Save codecademydev/b150f5fa5da5f5c852fcb09c4e27a5ea to your computer and use it in GitHub Desktop.
Codecademy export
#Write your function here
def max_num(nums):
largest = 0
for x in nums:
if x > largest:
largest = x
else:
return largest
#Uncomment the line below when your function is done
print(max_num([50, -10, 0, 75, 20]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment