Below is a program to compute the net run rate of given number of matches.


teamName = input("Enter the name of  Team :  ")
totalMatches = int(input("Enter the  number of matches played : "))

totalRun = 0   # to hold total runs
totalOvers = 0 # to hold total overs
if totalMatches > 5:
    print("You can enter Maximum 5 matches")
else:  
 for i in range(totalMatches):
     runs = int(input("Enter the  number of run scorred in match  " + str(i + 1) + ": "))
     overs = int(input("Enter the  number of overs " + str(i + 1) + ": "))
     totalRun = totalRun + runs
     totalOvers = totalOvers + overs
    
#computing net run rate only for max 5 matches 
if totalMatches <= 5:
    netRunRate = 0
    netRunRate = int(totalRun / totalOvers)
    print("Congrats " + teamName + " your net run rate is: " + str(netRunRate)) 
Python program to compute net run rate

Output:

Python program to compute net run rate

Explore More

What are Large Language Models

LLM stands for Large Language Model in the context of artificial intelligence. It refers to a type of AI model designed to understand, generate, and manipulate human language on a

Explain about Hugging Face Transformers

Hugging Face Transformers is a powerful library designed for natural language processing (NLP), computer vision, and audio tasks. It provides state-of-the-art pretrained models and tools for fine-tuning and deploying these

AI Roadmap using Python

Python is a great foundation for diving into AI! To take the next step in your AI learning journey, here’s a roadmap to guide you. 1. Strengthen Your Math Skills