Add Percentage Calculator with Input Validation#7
Open
abhiram-kadarla wants to merge 1 commit intomuskankhedia:mainfrom
Open
Add Percentage Calculator with Input Validation#7abhiram-kadarla wants to merge 1 commit intomuskankhedia:mainfrom
abhiram-kadarla wants to merge 1 commit intomuskankhedia:mainfrom
Conversation
muskankhedia
requested changes
Mar 6, 2026
Owner
muskankhedia
left a comment
There was a problem hiding this comment.
Please implement for an existing function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Overview
This pull request introduces a new utility module percentage_calculator.py to the Student Utility Library.
The module provides a reusable function to calculate percentage based on total marks and obtained marks, including proper input validation and formatted output.
✅ Features Implemented
(obtained_marks / total_marks) × 100
Example
Input:
Total Marks: 500
Obtained Marks: 420
Output:
Percentage: 84.00
FILE ADDED:
percentage_calculator.py.
Purpose of This Change
This utility enhances the Student Utility Library by providing a reliable and reusable percentage calculation function. It can be integrated into grading systems, academic tools, or other student-related modules in the future.
Testing:
The functionality was tested locally using sample inputs and verified for:
Correct percentage calculation
Proper rounding
Error handling for invalid inputs