How to get Python Compound Interest Calculator to give the correct answerfinal = P * (((1 + (r/n)) ** (n*t))) TypeError: unsupported operand type(s) for /: 'str' and 'int'How do I copy a file in Python?How can I safely create a nested directory in Python?How do I parse a string to a float or int in Python?How to get the current time in PythonHow can I make a time delay in Python?Getting the last element of a list in PythonHow do I get the number of elements in a list in Python?How do I concatenate two lists in Python?How do I lowercase a string in Python?Interest Calculator In Python

Risk of getting Chronic Wasting Disease (CWD) in the United States?

How to format long polynomial?

Finding angle with pure Geometry.

Watching something be written to a file live with tail

Show that if two triangles built on parallel lines, with equal bases have the same perimeter only if they are congruent.

How can bays and straits be determined in a procedurally generated map?

To string or not to string

Email Account under attack (really) - anything I can do?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

What does "Puller Prush Person" mean?

A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?

Why doesn't H₄O²⁺ exist?

Python: next in for loop

Approximately how much travel time was saved by the opening of the Suez Canal in 1869?

LaTeX closing $ signs makes cursor jump

What are the differences between the usage of 'it' and 'they'?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How old can references or sources in a thesis be?

can i play a electric guitar through a bass amp?

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

How does one intimidate enemies without having the capacity for violence?

Is a tag line useful on a cover?

How to write a macro that is braces sensitive?

What's the point of deactivating Num Lock on login screens?



How to get Python Compound Interest Calculator to give the correct answer


final = P * (((1 + (r/n)) ** (n*t))) TypeError: unsupported operand type(s) for /: 'str' and 'int'How do I copy a file in Python?How can I safely create a nested directory in Python?How do I parse a string to a float or int in Python?How to get the current time in PythonHow can I make a time delay in Python?Getting the last element of a list in PythonHow do I get the number of elements in a list in Python?How do I concatenate two lists in Python?How do I lowercase a string in Python?Interest Calculator In Python






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Had posted a question earlier about errors. Thanks to a few people here I was able to fix that issue. Now I've run into the issues of my Compound Interest Calculator giving the wrong calculation when you input the principal, compounded interest (yearly, monthly, etc..), interest rate (0.03, etc...), and the amount of years.
Other Q link: final = P * (((1 + (r/n)) ** (n*t))) TypeError: unsupported operand type(s) for /: 'str' and 'int'
So from the previous code I removed p = 10000, n = 12, r = 0.08 because it would give a large number when you input different numbers. My hope was it would calculate it with the numbers inputted, but it doesn't.



# User must input principal, Compound rate, annual rate, and years.
P = int(input("Enter starting principle please. "))
n = int(input("Enter Compound intrest rate.(daily, monthly, quarterly, half-year, yearly) "))
r = float(input("Enter annual interest amount. (decimal) "))
t = int(input("Enter the amount of years. "))

final = P * (((1 + (r/n)) ** (n*t)))
#displays the final amount after number of years.
print ("The final amount after", t, "years is", final)
# At the moment it is displaying a very random number.

Enter starting principle please. 1000
Enter Compound intrest rate.(daily, monthly, quarterly, half-year, yearly) 1
Enter annual interest amount. (decimal) 0.01
Enter the amount of years. 1
The final amount after 1 years is 1010.0


The final amount should be 1000.10. Not sure what is going on. Trying to see if there is a way to make P, n, r equal the number a user inputs that will result in the correct final answer.



Thanks in advance.










share|improve this question
























  • Why should it be 1000.10? If I understand correctly, yearly compound interest rate 0.01, so 1000*(1.01)^1=1010.0. Am I missing something here?

    – Sagar Waghmode
    Jan 22 '16 at 17:33











  • When I run the number through a compound interest calculator to triple check the answer it gives me 1000.10.

    – Joshua Gremo
    Jan 22 '16 at 17:40











  • Added an answer. Please check if this is what you want.

    – Sagar Waghmode
    Jan 22 '16 at 17:42


















0















Had posted a question earlier about errors. Thanks to a few people here I was able to fix that issue. Now I've run into the issues of my Compound Interest Calculator giving the wrong calculation when you input the principal, compounded interest (yearly, monthly, etc..), interest rate (0.03, etc...), and the amount of years.
Other Q link: final = P * (((1 + (r/n)) ** (n*t))) TypeError: unsupported operand type(s) for /: 'str' and 'int'
So from the previous code I removed p = 10000, n = 12, r = 0.08 because it would give a large number when you input different numbers. My hope was it would calculate it with the numbers inputted, but it doesn't.



# User must input principal, Compound rate, annual rate, and years.
P = int(input("Enter starting principle please. "))
n = int(input("Enter Compound intrest rate.(daily, monthly, quarterly, half-year, yearly) "))
r = float(input("Enter annual interest amount. (decimal) "))
t = int(input("Enter the amount of years. "))

final = P * (((1 + (r/n)) ** (n*t)))
#displays the final amount after number of years.
print ("The final amount after", t, "years is", final)
# At the moment it is displaying a very random number.

Enter starting principle please. 1000
Enter Compound intrest rate.(daily, monthly, quarterly, half-year, yearly) 1
Enter annual interest amount. (decimal) 0.01
Enter the amount of years. 1
The final amount after 1 years is 1010.0


The final amount should be 1000.10. Not sure what is going on. Trying to see if there is a way to make P, n, r equal the number a user inputs that will result in the correct final answer.



Thanks in advance.










share|improve this question
























  • Why should it be 1000.10? If I understand correctly, yearly compound interest rate 0.01, so 1000*(1.01)^1=1010.0. Am I missing something here?

    – Sagar Waghmode
    Jan 22 '16 at 17:33











  • When I run the number through a compound interest calculator to triple check the answer it gives me 1000.10.

    – Joshua Gremo
    Jan 22 '16 at 17:40











  • Added an answer. Please check if this is what you want.

    – Sagar Waghmode
    Jan 22 '16 at 17:42














0












0








0








Had posted a question earlier about errors. Thanks to a few people here I was able to fix that issue. Now I've run into the issues of my Compound Interest Calculator giving the wrong calculation when you input the principal, compounded interest (yearly, monthly, etc..), interest rate (0.03, etc...), and the amount of years.
Other Q link: final = P * (((1 + (r/n)) ** (n*t))) TypeError: unsupported operand type(s) for /: 'str' and 'int'
So from the previous code I removed p = 10000, n = 12, r = 0.08 because it would give a large number when you input different numbers. My hope was it would calculate it with the numbers inputted, but it doesn't.



# User must input principal, Compound rate, annual rate, and years.
P = int(input("Enter starting principle please. "))
n = int(input("Enter Compound intrest rate.(daily, monthly, quarterly, half-year, yearly) "))
r = float(input("Enter annual interest amount. (decimal) "))
t = int(input("Enter the amount of years. "))

final = P * (((1 + (r/n)) ** (n*t)))
#displays the final amount after number of years.
print ("The final amount after", t, "years is", final)
# At the moment it is displaying a very random number.

Enter starting principle please. 1000
Enter Compound intrest rate.(daily, monthly, quarterly, half-year, yearly) 1
Enter annual interest amount. (decimal) 0.01
Enter the amount of years. 1
The final amount after 1 years is 1010.0


The final amount should be 1000.10. Not sure what is going on. Trying to see if there is a way to make P, n, r equal the number a user inputs that will result in the correct final answer.



Thanks in advance.










share|improve this question
















Had posted a question earlier about errors. Thanks to a few people here I was able to fix that issue. Now I've run into the issues of my Compound Interest Calculator giving the wrong calculation when you input the principal, compounded interest (yearly, monthly, etc..), interest rate (0.03, etc...), and the amount of years.
Other Q link: final = P * (((1 + (r/n)) ** (n*t))) TypeError: unsupported operand type(s) for /: 'str' and 'int'
So from the previous code I removed p = 10000, n = 12, r = 0.08 because it would give a large number when you input different numbers. My hope was it would calculate it with the numbers inputted, but it doesn't.



# User must input principal, Compound rate, annual rate, and years.
P = int(input("Enter starting principle please. "))
n = int(input("Enter Compound intrest rate.(daily, monthly, quarterly, half-year, yearly) "))
r = float(input("Enter annual interest amount. (decimal) "))
t = int(input("Enter the amount of years. "))

final = P * (((1 + (r/n)) ** (n*t)))
#displays the final amount after number of years.
print ("The final amount after", t, "years is", final)
# At the moment it is displaying a very random number.

Enter starting principle please. 1000
Enter Compound intrest rate.(daily, monthly, quarterly, half-year, yearly) 1
Enter annual interest amount. (decimal) 0.01
Enter the amount of years. 1
The final amount after 1 years is 1010.0


The final amount should be 1000.10. Not sure what is going on. Trying to see if there is a way to make P, n, r equal the number a user inputs that will result in the correct final answer.



Thanks in advance.







python calculator






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 '17 at 12:31









Community

11




11










asked Jan 22 '16 at 17:30









Joshua GremoJoshua Gremo

6115




6115












  • Why should it be 1000.10? If I understand correctly, yearly compound interest rate 0.01, so 1000*(1.01)^1=1010.0. Am I missing something here?

    – Sagar Waghmode
    Jan 22 '16 at 17:33











  • When I run the number through a compound interest calculator to triple check the answer it gives me 1000.10.

    – Joshua Gremo
    Jan 22 '16 at 17:40











  • Added an answer. Please check if this is what you want.

    – Sagar Waghmode
    Jan 22 '16 at 17:42


















  • Why should it be 1000.10? If I understand correctly, yearly compound interest rate 0.01, so 1000*(1.01)^1=1010.0. Am I missing something here?

    – Sagar Waghmode
    Jan 22 '16 at 17:33











  • When I run the number through a compound interest calculator to triple check the answer it gives me 1000.10.

    – Joshua Gremo
    Jan 22 '16 at 17:40











  • Added an answer. Please check if this is what you want.

    – Sagar Waghmode
    Jan 22 '16 at 17:42

















Why should it be 1000.10? If I understand correctly, yearly compound interest rate 0.01, so 1000*(1.01)^1=1010.0. Am I missing something here?

– Sagar Waghmode
Jan 22 '16 at 17:33





Why should it be 1000.10? If I understand correctly, yearly compound interest rate 0.01, so 1000*(1.01)^1=1010.0. Am I missing something here?

– Sagar Waghmode
Jan 22 '16 at 17:33













When I run the number through a compound interest calculator to triple check the answer it gives me 1000.10.

– Joshua Gremo
Jan 22 '16 at 17:40





When I run the number through a compound interest calculator to triple check the answer it gives me 1000.10.

– Joshua Gremo
Jan 22 '16 at 17:40













Added an answer. Please check if this is what you want.

– Sagar Waghmode
Jan 22 '16 at 17:42






Added an answer. Please check if this is what you want.

– Sagar Waghmode
Jan 22 '16 at 17:42













4 Answers
4






active

oldest

votes


















1














If you are entering interest in percentages, you should take care of that in your code.



final = P * (((1 + (r/(100.0 * n))) ** (n*t)))





share|improve this answer























  • Ahhh. didn't even think about that. Thanks, I will run it now and let you know.

    – Joshua Gremo
    Jan 22 '16 at 17:42











  • It works! Thank you, been doing these projects since 6am, can't believe I missed that. Appreciate the help @ Sagar

    – Joshua Gremo
    Jan 22 '16 at 17:44











  • Welcome. Please accept the answer if it solved your problem. :P

    – Sagar Waghmode
    Jan 22 '16 at 17:45


















1














Please try the below Python code for Compound Interest:



p = float(input('Please enter principal amount:'))
t = float(input('Please enter number of years:'))
r = float(input('Please enter rate of interest:'))
n = float(input('Please enter number of times the interest is compounded in a year:'))
a = p*(1+(r/(100*n))**(n*t))
print('Amount compounded to: ', a)





share|improve this answer
































    0














    Based on this:
    Compound Interest Formula
    FV = P (1 + r / n)^Yn,
    where P is the starting principal, r is the annual interest rate, Y is the number of years invested, and n is the number of compounding periods per year. FV is the future value, meaning the amount the principal grows to after Y years.



    P = int(input("Enter starting principle please. "))
    n = int(input("Enter number of compounding periods per year. "))
    r = float(input("Enter annual interest rate. e.g. 15 for 15% "))
    y = int(input("Enter the amount of years. "))

    FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

    print ("The final amount after", y, "years is", FV)





    share|improve this answer






























      0














      P = int(input("Enter starting principle please: "))
      n = int(input("Enter number of compounding periods per year: "))
      r = float(input("Enter annual interest rate: "))
      y = int(input("Enter the amount of years: "))

      FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

      print ("The final amount after", y, "years is", FV)





      share|improve this answer























        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34952669%2fhow-to-get-python-compound-interest-calculator-to-give-the-correct-answer%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1














        If you are entering interest in percentages, you should take care of that in your code.



        final = P * (((1 + (r/(100.0 * n))) ** (n*t)))





        share|improve this answer























        • Ahhh. didn't even think about that. Thanks, I will run it now and let you know.

          – Joshua Gremo
          Jan 22 '16 at 17:42











        • It works! Thank you, been doing these projects since 6am, can't believe I missed that. Appreciate the help @ Sagar

          – Joshua Gremo
          Jan 22 '16 at 17:44











        • Welcome. Please accept the answer if it solved your problem. :P

          – Sagar Waghmode
          Jan 22 '16 at 17:45















        1














        If you are entering interest in percentages, you should take care of that in your code.



        final = P * (((1 + (r/(100.0 * n))) ** (n*t)))





        share|improve this answer























        • Ahhh. didn't even think about that. Thanks, I will run it now and let you know.

          – Joshua Gremo
          Jan 22 '16 at 17:42











        • It works! Thank you, been doing these projects since 6am, can't believe I missed that. Appreciate the help @ Sagar

          – Joshua Gremo
          Jan 22 '16 at 17:44











        • Welcome. Please accept the answer if it solved your problem. :P

          – Sagar Waghmode
          Jan 22 '16 at 17:45













        1












        1








        1







        If you are entering interest in percentages, you should take care of that in your code.



        final = P * (((1 + (r/(100.0 * n))) ** (n*t)))





        share|improve this answer













        If you are entering interest in percentages, you should take care of that in your code.



        final = P * (((1 + (r/(100.0 * n))) ** (n*t)))






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 22 '16 at 17:39









        Sagar WaghmodeSagar Waghmode

        637414




        637414












        • Ahhh. didn't even think about that. Thanks, I will run it now and let you know.

          – Joshua Gremo
          Jan 22 '16 at 17:42











        • It works! Thank you, been doing these projects since 6am, can't believe I missed that. Appreciate the help @ Sagar

          – Joshua Gremo
          Jan 22 '16 at 17:44











        • Welcome. Please accept the answer if it solved your problem. :P

          – Sagar Waghmode
          Jan 22 '16 at 17:45

















        • Ahhh. didn't even think about that. Thanks, I will run it now and let you know.

          – Joshua Gremo
          Jan 22 '16 at 17:42











        • It works! Thank you, been doing these projects since 6am, can't believe I missed that. Appreciate the help @ Sagar

          – Joshua Gremo
          Jan 22 '16 at 17:44











        • Welcome. Please accept the answer if it solved your problem. :P

          – Sagar Waghmode
          Jan 22 '16 at 17:45
















        Ahhh. didn't even think about that. Thanks, I will run it now and let you know.

        – Joshua Gremo
        Jan 22 '16 at 17:42





        Ahhh. didn't even think about that. Thanks, I will run it now and let you know.

        – Joshua Gremo
        Jan 22 '16 at 17:42













        It works! Thank you, been doing these projects since 6am, can't believe I missed that. Appreciate the help @ Sagar

        – Joshua Gremo
        Jan 22 '16 at 17:44





        It works! Thank you, been doing these projects since 6am, can't believe I missed that. Appreciate the help @ Sagar

        – Joshua Gremo
        Jan 22 '16 at 17:44













        Welcome. Please accept the answer if it solved your problem. :P

        – Sagar Waghmode
        Jan 22 '16 at 17:45





        Welcome. Please accept the answer if it solved your problem. :P

        – Sagar Waghmode
        Jan 22 '16 at 17:45













        1














        Please try the below Python code for Compound Interest:



        p = float(input('Please enter principal amount:'))
        t = float(input('Please enter number of years:'))
        r = float(input('Please enter rate of interest:'))
        n = float(input('Please enter number of times the interest is compounded in a year:'))
        a = p*(1+(r/(100*n))**(n*t))
        print('Amount compounded to: ', a)





        share|improve this answer





























          1














          Please try the below Python code for Compound Interest:



          p = float(input('Please enter principal amount:'))
          t = float(input('Please enter number of years:'))
          r = float(input('Please enter rate of interest:'))
          n = float(input('Please enter number of times the interest is compounded in a year:'))
          a = p*(1+(r/(100*n))**(n*t))
          print('Amount compounded to: ', a)





          share|improve this answer



























            1












            1








            1







            Please try the below Python code for Compound Interest:



            p = float(input('Please enter principal amount:'))
            t = float(input('Please enter number of years:'))
            r = float(input('Please enter rate of interest:'))
            n = float(input('Please enter number of times the interest is compounded in a year:'))
            a = p*(1+(r/(100*n))**(n*t))
            print('Amount compounded to: ', a)





            share|improve this answer















            Please try the below Python code for Compound Interest:



            p = float(input('Please enter principal amount:'))
            t = float(input('Please enter number of years:'))
            r = float(input('Please enter rate of interest:'))
            n = float(input('Please enter number of times the interest is compounded in a year:'))
            a = p*(1+(r/(100*n))**(n*t))
            print('Amount compounded to: ', a)






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 8 at 4:30









            Pikachu the Purple Wizard

            2,06561529




            2,06561529










            answered Mar 8 at 4:07









            Srihari RaoSrihari Rao

            112




            112





















                0














                Based on this:
                Compound Interest Formula
                FV = P (1 + r / n)^Yn,
                where P is the starting principal, r is the annual interest rate, Y is the number of years invested, and n is the number of compounding periods per year. FV is the future value, meaning the amount the principal grows to after Y years.



                P = int(input("Enter starting principle please. "))
                n = int(input("Enter number of compounding periods per year. "))
                r = float(input("Enter annual interest rate. e.g. 15 for 15% "))
                y = int(input("Enter the amount of years. "))

                FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

                print ("The final amount after", y, "years is", FV)





                share|improve this answer



























                  0














                  Based on this:
                  Compound Interest Formula
                  FV = P (1 + r / n)^Yn,
                  where P is the starting principal, r is the annual interest rate, Y is the number of years invested, and n is the number of compounding periods per year. FV is the future value, meaning the amount the principal grows to after Y years.



                  P = int(input("Enter starting principle please. "))
                  n = int(input("Enter number of compounding periods per year. "))
                  r = float(input("Enter annual interest rate. e.g. 15 for 15% "))
                  y = int(input("Enter the amount of years. "))

                  FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

                  print ("The final amount after", y, "years is", FV)





                  share|improve this answer

























                    0












                    0








                    0







                    Based on this:
                    Compound Interest Formula
                    FV = P (1 + r / n)^Yn,
                    where P is the starting principal, r is the annual interest rate, Y is the number of years invested, and n is the number of compounding periods per year. FV is the future value, meaning the amount the principal grows to after Y years.



                    P = int(input("Enter starting principle please. "))
                    n = int(input("Enter number of compounding periods per year. "))
                    r = float(input("Enter annual interest rate. e.g. 15 for 15% "))
                    y = int(input("Enter the amount of years. "))

                    FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

                    print ("The final amount after", y, "years is", FV)





                    share|improve this answer













                    Based on this:
                    Compound Interest Formula
                    FV = P (1 + r / n)^Yn,
                    where P is the starting principal, r is the annual interest rate, Y is the number of years invested, and n is the number of compounding periods per year. FV is the future value, meaning the amount the principal grows to after Y years.



                    P = int(input("Enter starting principle please. "))
                    n = int(input("Enter number of compounding periods per year. "))
                    r = float(input("Enter annual interest rate. e.g. 15 for 15% "))
                    y = int(input("Enter the amount of years. "))

                    FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

                    print ("The final amount after", y, "years is", FV)






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Aug 4 '18 at 16:39









                    Tom KliseTom Klise

                    1




                    1





















                        0














                        P = int(input("Enter starting principle please: "))
                        n = int(input("Enter number of compounding periods per year: "))
                        r = float(input("Enter annual interest rate: "))
                        y = int(input("Enter the amount of years: "))

                        FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

                        print ("The final amount after", y, "years is", FV)





                        share|improve this answer



























                          0














                          P = int(input("Enter starting principle please: "))
                          n = int(input("Enter number of compounding periods per year: "))
                          r = float(input("Enter annual interest rate: "))
                          y = int(input("Enter the amount of years: "))

                          FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

                          print ("The final amount after", y, "years is", FV)





                          share|improve this answer

























                            0












                            0








                            0







                            P = int(input("Enter starting principle please: "))
                            n = int(input("Enter number of compounding periods per year: "))
                            r = float(input("Enter annual interest rate: "))
                            y = int(input("Enter the amount of years: "))

                            FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

                            print ("The final amount after", y, "years is", FV)





                            share|improve this answer













                            P = int(input("Enter starting principle please: "))
                            n = int(input("Enter number of compounding periods per year: "))
                            r = float(input("Enter annual interest rate: "))
                            y = int(input("Enter the amount of years: "))

                            FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

                            print ("The final amount after", y, "years is", FV)






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 8 at 22:46









                            LeqitShxdowLeqitShxdow

                            31




                            31



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34952669%2fhow-to-get-python-compound-interest-calculator-to-give-the-correct-answer%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

                                Алба-Юлія

                                Захаров Федір Захарович