You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is a fully--functioning Python application. The program has all the basic functionality to calculate monthly income (taking into account revenue and costs). Includingg:
Function-:
calculate_monthly_profit - This function is used to calculate success.
User Interface: the main function prompts the user for data, showing the result.
Error handling: The app displays the correct message if the user's data is incorrect.
defcalculate_monthly_profit(revenue, expenses):
try:
profit=revenue-expensesreturnprofitexceptTypeError:
return"Revenue and costs must be numeric values."defmain():
print("Monthly income calculation program")
print("---------------------------------")
try:
revenue=float(input("Enter monthly income (tenge): "))
expenses=float(input("Enter monthly expenses (tenge): "))
profit=calculate_monthly_profit(revenue, expenses)
print("---------------------------------")
print(f"Net profit: {profit:.2f} tenge")
exceptValueError:
print("Error! Revenue and costs must be numeric values.")
exceptExceptionase:
print(f"An error occurred with the app: {e}")
if__name__=="__main__":
main()
Feature description
O uso e livre para editar
The text was updated successfully, but these errors were encountered: