Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added python program for tip calculator - Tipcalculator.py #8120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KYashnandan
Copy link

Problem

Inconsistent behavior in the tip calculation for user inputs leading to confusion and errors during execution.

Solution

Implemented input validation and improved output clarity to enhance user experience and prevent invalid data entry.

Changes Proposed

1.Added input validation to ensure positive numeric values for both tip percentage and bill amount.
2. Updated output messages to be clearer and more descriptive, removing formatted strings in favor of concatenation.
3. Created a separate function for displaying results to maintain code organization and readability.

Other Changes

1.Refactored exception handling to provide more informative error messages.
2.Improved function naming conventions for better code clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant