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

Exemplo de conta de lucro mensal em python #12525

Closed
luizgustavo76 opened this issue Jan 16, 2025 · 1 comment
Closed

Exemplo de conta de lucro mensal em python #12525

luizgustavo76 opened this issue Jan 16, 2025 · 1 comment
Labels
enhancement This PR modified some existing files

Comments

@luizgustavo76
Copy link

Feature description

O uso e livre para editar

@luizgustavo76 luizgustavo76 added the enhancement This PR modified some existing files label Jan 16, 2025
@Andjaksy
Copy link

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.

def calculate_monthly_profit(revenue, expenses):
    try:
        profit = revenue - expenses
        return profit
    except TypeError:
        return "Revenue and costs must be numeric values."
def main():

    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")
    except ValueError:
        print("Error! Revenue and costs must be numeric values.")
    except Exception as e:
        print(f"An error occurred with the app: {e}")

if __name__ == "__main__":
    main()

@tianyizheng02 tianyizheng02 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

No branches or pull requests

4 participants
@tianyizheng02 @Andjaksy @luizgustavo76 and others