Created
February 12, 2021 21:27
-
-
Save cbscribe/8622222d281bad12d758ff303e64e108 to your computer and use it in GitHub Desktop.
FInd largest number in a list
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
| numbers = [1, 5, 0, 39, 6, 809, 39, 2] | |
| biggest = numbers[0] | |
| for num in numbers: | |
| if num > biggest: | |
| biggest = num | |
| print(biggest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this pattern when you want to find the biggest/smallest/etc value in some list of values.