CommencerCommencer gratuitement

Assigning dependencies for expenses

Txs Tools wants to assign a dependency for its operating expenses, particularly admin salaries.

The conditions are as follows:

  • Admin expenses increase in July and August (Jul and Aug) as temporary workers need to be hired to cover the summer holiday.
  • The increase is based on the number of employees taking holidays during that time. For the current year, the value for August is emp_leave = 6 (6 employees expected to take leave).
  • The cost is 80 USD per temp employee hired.

Cet exercice fait partie du cours

Financial Forecasting in Python

Afficher le cours

Instructions

  • Using an if statement, calculate the dependency for the admin expenses admin_dep for August only by using a calculation that multiplies the employees expected to take leave (using the variable emp_leave) by the USD rate per employee.
  • Print the resultant variable you have calculated.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Set the admin dependency
if emp_leave > 0:
    admin_dep = ____ * ____

# Print the results
print("The admin dependency for August is {} USD.".format(____))
Modifier et exécuter le code