Programming Examples
Python program to input total debt and total assets and calculate total debt to total assets ratio and check whether major funded by assets or equity
Write a program to input total debt and total assets and calculate total-debt-to-total-assets ratio (TD/TA) as Total Debt/Total Assets. Then print if the major portion of the debt is funded by assets (when TD/TA > 1) or greater portion of assets is funded by equity (when TD/TA < 1).
Solution
total_debt = float(input("Enter total debt : "))
total_assets = float(input("Enter total assets : "))
ratio = total_debt / total_assets
if ratio > 1 :
print("the major portion of the debt is funded by assets ")
else :
print("greater portion of assets is funded by equity ")
Output/ Explanation:
Enter total debt : 4000
Enter total assets : 2000
the major portion of the debt is funded by assets
>>>
========================
Enter total debt : 5000
Enter total assets : 12000
greater portion of assets is funded by equity