Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Find the Runner Up Score solution in python3

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)
Comment

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}")
Comment

PREVIOUS NEXT
Code Example
Python :: python sendmessage whatsapp 
Python :: plotly set axes limits 
Python :: check cuda version pytorch 
Python :: mean squared error python 
Python :: how to save a dictionary to excel in python 
Python :: negative cv2 
Python :: f string round 
Python :: python tkinter filedialog folder 
Python :: py get mouse coordinates 
Python :: python turtle line thickness 
Python :: How to Add a Title to Seaborn Plots 
Python :: get role from name discord.py 
Python :: get time taken to execute python script 
Python :: dropdown in tkinter 
Python :: python read url 
Python :: python check my gpu 
Python :: list of prime numbers in python 
Python :: openpyxl read excel 
Python :: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. 
Python :: python deep copy of a dictionary 
Python :: python install package from code 
Python :: tkinter navigate pages 
Python :: python f-string format date 
Python :: how to print numbers from 1 to 20 in python 
Python :: how to find if a value is even or odd in python 
Python :: plt.clear 
Python :: get list of all files in folder and subfolders python 
Python :: pandas find top 10 values in column 
Python :: polynomial fit in python 
Python :: pandas convert column to index 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =