Skip to content

This project includes a function that calculates the final price after applying a discount, only if the discount is 20% or more. It demonstrates conditional logic, input handling, and basic arithmetic operations in Python.

License

Notifications You must be signed in to change notification settings

software-development-course-2025/python-week-3-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Έ Discount Calculator

This Python script calculates the final price of an item after applying a discount β€” but only if the discount is 20% or more.

πŸš€ How It Works

  1. User enters the original price and discount percentage
  2. If the discount is >= 20%, it's applied
  3. Otherwise, the original price is returned
  4. Invalid input is handled gracefully

πŸ’‘ Example Output

Enter the original price: 100
Enter the discount percentage: 25
Discount applied! Final price: $75.00

Enter the discount percentage: 15
No discount applied. Final price: $100.00

πŸ“‚ Files

  • discount_calculator.py: Core script

πŸ‘¨β€πŸ’» Author

Augusto Mate
πŸ“§ mate.augusto.mz@gmail.com

πŸͺͺ License

This project is licensed under the MIT License.

About

This project includes a function that calculates the final price after applying a discount, only if the discount is 20% or more. It demonstrates conditional logic, input handling, and basic arithmetic operations in Python.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages