Get startedGet started for free

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.

This exercise is part of the course

Financial Forecasting in Python

View Course

Exercise 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.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

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

# Print the results
print("The admin dependency for August is {} USD.".format(____))
Edit and Run Code