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

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 

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad