Compute EMIs for a loan using the numpy or scipy libraries.

import numpy as np
 
principal_amt=float(input('enter amount borrowed '))
rate_interest=float(input('enter rate of compound interest '))
years=float(input('enter years '))
months=int(input('enter months '))
time=12*years+months
emi=np.pmt((rate_interest/100)/12,time,principal_amt)
emi=emi*(-1)
print('you have to pay '+str(emi)+' per month')
 
Explanation: In this program we are importing numpy library. numpy is a python library in which we have many functions related to numbers, data and mathematics. first we are getting user input in float format. we have taken principal amount, rate of interest, time in years and months.
 
we are calculating EMI with pmt function, time is given in integer format in months. since pmt returns value with minus sign, emi is multiplied with -1 to show in positive integer value. finally message is printed by concatenating strings with plus operator.