Advertisement
dprincef

Untitled

May 15th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. scores = int(input('Enter the number of scores: '))
  2. inp = input('Enter the scores : ').split(' ')
  3. array = []
  4. new_list = []
  5. max = 0
  6.  
  7. for i in inp:
  8.     array.append(int(i))
  9. array.sort()
  10. for i in array:
  11.     if scores < len(array) or scores > len(array):
  12.        
  13.         print('Number of Scores does not conform with the scores you input')
  14.         break
  15.     if scores not in range(2,11):
  16.         break
  17.    
  18.     elif i > max:
  19.        
  20.         max = i
  21.         new_list.append(max)
  22. print(new_list[-2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement