DEV Community

Cover image for Find Runner Up Score | Python Program
Madhuban Khatri
Madhuban Khatri

Posted on

2 1

Find Runner Up Score | Python Program

Hello Developers,
I am Madhuban Khatri, a Self-Taught Programmer who create Programming Projects or Videos on YouTube. In this post, I am creating a Simple Runner Up Score Program in PYTHON3.

Here is the video:-

Python Code

# Create a Score List
score_lis = [1,2,3,4,5,6,6,6,7,8,9,9,9,10,10,10,10]

# Print the List
print('Current Scores: ', score_lis)

# Get Max Number from the list
max_num = max(score_lis)

# Count the Max Number 
max_num_count = score_lis.count(max_num)

# Apply for loop and remove Max Number from the list
for i in range(0, max_num_count):
    score_lis.remove(max_num)


# Now Max Number becomes the Runner Up Score
runner_up = max(score_lis)

# Print it
print('Runner Up Score is: ', runner_up)
Enter fullscreen mode Exit fullscreen mode

Simple but Useful.

Check out my new Videos on YouTube

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay