Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- arr = [...]
- first_min, second_min = 0, 0
- if len(arr) == 1:
- first_min = arr[0]
- print("there is one min = ", first_min)
- else:
- first_min, second_min = min(arr[0], arr[1]), max(arr[0], arr[1])
- for element in arr:
- if element <= first_min:
- second_min = first_min
- first_min = element
- elif element < second_min:
- second_min = element
- print("there is two mins = ", firstmin, second_min)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement