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.

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.33
9
Tatenda 85 points

                                    # Find the Runner-Up Score! in Python - Hacker Rank Solution
if __name__ == '__main__':
    n = int(raw_input())
    arr = map(int, raw_input().split())
    # Find the Runner-Up Score! in Python - Hacker Rank Solution START
    print(sorted(list(set(arr)))[-2])
    # Find the Runner-Up Score! in Python - Hacker Rank Solution END

4.33 (9 Votes)
0
4
5

                                    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 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 finding the runner up score runner up score Find the Runner-Up Score! answer find runner up score 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 python find the runner-up score with same value python find the runner-up score Find the Runner-Up Score! what is runner up score find runner up score 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