Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def largest(list):
- start=0
- for number in list:
- if number>start:
- start=number
- return start
- def smallest(list):
- start=2
- for number in list:
- if number<start:
- start=number
- return start
- list=[1,13,4,11,4,50,33,15,10,12,12,45,2,1,-1]
- print(largest(list))
- print(smallest(list))
Add Comment
Please, Sign In to add comment