MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Financial Forecasting in Python

Lihat Kursus

Petunjuk latihan

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

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

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

# Print the results
print("The admin dependency for August is {} USD.".format(____))
Edit dan Jalankan Kode