Highest score in python with source code

Highest score in python with source code

Introduction

Highest score is a python based programming project. It is the best way of finding the largest score among multiple scores.

The highest score is a python version 3.9 based program. It is a logical program for finding the high score. It is a command-line based program. The program asks the user to enter a set of numbers separated by spaces.

The program will return the score that is highest among the entered numbers. We are using for loop and if control statement to get the result. It is a useful programming exercise for beginners. It is simple and easy to understand the basics. See the code below.

student_scores = input("Input a list of student scores: ").split()
for n in range(0,  len(student_scores)):
    student_scores[n] = int(student_scores[n])
print(student_scores)

high_score = 0
for scores in student_scores:
    if scores > high_score:
        high_score = scores
print(f"The highest score in the class is {high_score}")

Output

highest score

How to use highest score program?

  • Copy the source code in your editor or IDE. (pycharm, anaconda)
  • Execute the program.
  • Input some number and get the highest or high score