how to find runner up score in python

price=[10,20,4,5,4,6,46,43,4,64,65,8,45,55,558,15,5,4,6,5,255,5]
price.sort()
price.reverse()
max=price[0]
sec_max=price[1]
print(price)
print(f"the max is {max}, runner up is {sec_max}")

4.2
5

                                    from collections import Counter
if __name__ == '__main__':
    n = int(raw_input())
    arr = Counter(map(int, raw_input().split())).keys()
    arr.sort()
    print arr[-2]

4.2 (5 Votes)
0
4.5
8
Lolol 110 points

                                    n = int(input())
arr = list(map(int, input().split()))
zes = max(arr)
i=0
while(i<n):
    if zes ==max(arr):
        arr.remove(max(arr))
    i+=1
print(max(arr))
#note: do not  use set() will not work for negative numbers
# contact me : [email protected]

4.5 (8 Votes)
0
4.5
3
Vkarve 120 points

                                    if __name__ == '__main__':
    n = int(input())
    arr = map(int, input().split())
    arr = list(arr)
    x = max(arr)
    y = -9999999
    for i in range(0,n):
        if arr[i]<x and arr[i] > y:
            y = arr[i]
    
    print(y)

4.5 (2 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
solving find the runner up score runner up score hacker rank solution finding the runner up score find the runner up score hackerrank python solution Runner up score hacker rank find the runner-up score python hackerrank solution find runner up score hack3errank solution hackerrank runner up score solution Find the Runner-Up Score! hackerrank solution runner up score Find the Runner-Up Score! answer find runner up score runner up score hackerrank hackerrank Find the Runner-Up Score! find the runner up score hackerrank what is the runner up score runner up score program in python solution runner up score program in python Find the Runner-Up Score! python 2,3,4,5,5,5 finding runner up in python python list runner up value python runner up score what is a runner up score python what is a runner up score hackerrank find the runner-up score find the runner-up score in python hackerrank solution runner up score python what is runner up sfcorre hackerrank runner up score get runnerup list find the runner-up score hackerrank solution python 3 runner-up score in list hackerrank runner up find the runner-up score hackerrank solution how to check for runner up score in python Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given scores. Store them in a list and find the score of the runner-up. how to find runner up score in python find the runner up score hackerrank solution in python runner up score hackerrank solution python find the runner-up score with same value python find the runner-up score python hackerrank solutions Find the Runner-Up Score! Find the Runner-Up Score! python Find the Runner-Up Score! hackerrank solution what is runner up score find runner up score in python Find the Runner-Up Score! hackerrank solution python find the runner-up score hackerrank solution in python find the runner up score in python runner up score in python find the runner-up score python second runner up python challenge runner up program in python code for runner up in python find the runner-up score in python runnerup number in an array runner up in python find the runner up score hackerrank python Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given n scores. Store them in a list and find the score of the runner-up. Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given scores. Store them in a list and find the score of the runner-up Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given scores. Store them in a list and find the score of the runner-up. find the runner-up score
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source