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 :: import matplotlib.pyplot as plt 
Python :: django how to set a navbar active 
Python :: matplotlib grid in background 
Python :: df dropna ensure that one column is not nan 
Python :: pandas append dictionary to dataframe 
Python :: run JupyterLab 
Python :: ckeditor django 
Python :: pandas plot xlabel 
Python :: how to get all links text from a website python beautifulsoup 
Python :: read csv python pandas plot 
Python :: To check pip version 
Python :: python pandas apply to one column 
Python :: special characters list in python 
Python :: how to plot 2 decimal values in axis python 
Python :: current year in python 
Python :: python querystring parse 
Python :: add authorization header in python requests 
Python :: name exit not defined python 
Python :: how to maker loops coun t in second in pytho 
Python :: List comprehension - list files with extension in a directory 
Python :: datetime one month ago python 
Python :: mp4 to mp3 in python 
Python :: format date field in pandas 
Python :: xpath beautifulsoup 
Python :: check key pressed pygame 
Python :: update python 3.10 ubuntu 
Python :: flask getting started 
Python :: sort list by attribute python 
Python :: how to make otp generator in python 
Python :: python - exclude rowin data frame based on value 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =