Skip to content

Yalew2025/Python-Assignment-week-3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Python-Assignment-week-3

Answer to the python week 3 assignment def calculate_discount(price, discount_percent): if discount_percent >= 20: discount_amount = price * (discount_percent / 100) final_price = price - discount_amount return final_price else: return price

Prompt the user for input

original_price = float(input("Enter the original price of the item: ")) discount_percentage = float(input("Enter the discount percentage: "))

Calculate the final price

final_price = calculate_discount(original_price, discount_percentage)

Print the result

print(f"The final price after applying the discount is: ${final_price:.2f}")

About

Answer to the python week 3 assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published