SIP calculator-

SIP calculator-

Step 1: #Function to calculate SIP Maturity Value

def calculate_sip(principal, rate, time):

# Convert annual rate to a monthly rate

monthly_rate = rate / (12 * 100)

# Total number of months

months = time * 12

# SIP maturity formula

sip_maturity_value = principal * (((1 + monthly_rate) ** months - 1) / monthly_rate) * (1 + monthly_rate)

return sip_maturity_value

#SIP Maturity Value=(P×(((1+r)**n )?1)×(1+r)/r)

step 2: #Get user inputs for principal (monthly investment), rate (annual interest rate), and time (investment duration in years)

principal = float(input("Enter the monthly investment (SIP amount): "))

rate = float(input("Enter the annual interest rate (in %): "))

time = float(input("Enter the time period (in years): "))

step 3: #Calculate the SIP maturity value

maturity_value = calculate_sip(principal, rate, time)

step 4: #Display the result

print(f"The SIP maturity value after {time} years is: {maturity_value:.2f}")


#Programming #Coding #Code #Developer #SoftwareEngineering #100DaysOfCode #Tech #WomenInTech (if applicable) #DataScience #MachineLearning #AI #Python

#PythonProgramming #LearnPython #PythonDeveloper #PythonForDataScience #PythonTips #PythonCode #PythonCommunity

要查看或添加评论,请登录

Er Deepak的更多文章

  • Finding the Maximum Digit from a String in Python--

    Finding the Maximum Digit from a String in Python--

    In today’s digital age, efficiently manipulating and analyzing strings is a crucial skill for any programmer. In this…

  • Based on Python Programming Language-

    Based on Python Programming Language-

    Correct Answer: Explanation: In Python, the operator follows short-circuit logic: Step 1: It checks the first operand .…

    2 条评论
  • Operators in Python Language-

    Operators in Python Language-

    Python provides a variety of operators to perform operations on variables and values. Here's a quick breakdown with…

  • Dictionary in Python-

    Dictionary in Python-

    #What is a Dictionary in #Python? A dictionary in Python is a built-in data structure that stores data in key-value…

    2 条评论
  • What is retrofitting?

    What is retrofitting?

    Often retrofit involves modifications to existing commercial buildings that may improve energy efficiency or decrease…

  • Why Most us ( Civil Engineers ) not getting job after completing their Bachlor in Technology?

    Why Most us ( Civil Engineers ) not getting job after completing their Bachlor in Technology?

    Introduction: Hi everyone, today I want to talk about why many civil engineering graduates are struggling to find jobs…

    1 条评论

社区洞察

其他会员也浏览了