Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def start(lst):
- for j in range (0,len(lst)-1):
- if int(lst[j]) > int(lst[j+1]):
- lst.insert(len(lst)-1,lst.pop(j))
- start(lst)
- return lst[-2]
- def second_largest_item(my_list):
- x = start(my_list)
- print('\n\t=> second largest item = ' + str(x) + '\n')
- second_largest_item([ 4,61,72,2,5,85,3,1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement