Python Forum
how do i rewrite this code to give me 10 outputs
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do i rewrite this code to give me 10 outputs
#1
# File: Futurevalue.py
# A simple program illustrating the future value of a savings account in 10 years
def main():
    p = eval(input ("Enter the initial principal amount in the savings account: "))
    apr = eval(input ("Enter the annual interest rate: " ))
    for i in range(10):
        p = p*(1 + apr)
                                 
    print("The value in 10 years is:", p)
    


main()
Reply


Messages In This Thread
how do i rewrite this code to give me 10 outputs - by BlackPimpernel - Mar-29-2018, 02:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  format json outputs ! evilcode1 3 1,758 Oct-29-2023, 01:30 PM
Last Post: omemoe277
  Formatting outputs created with .join command klairel 2 635 Aug-23-2023, 08:52 AM
Last Post: perfringo
  Code works but doesn't give the right results colin_dent 2 722 Jun-22-2023, 06:04 PM
Last Post: jefsummers
  I have written a program that outputs data based on GPS signal kalle 1 1,180 Jul-22-2022, 12:10 AM
Last Post: mcmxl22
  Why does absence of print command outputs quotes in function? Mark17 2 1,390 Jan-04-2022, 07:08 PM
Last Post: ndc85430
  Thoughts on interfacing with a QR code reader that outputs keystrokes? wrybread 1 1,486 Oct-08-2021, 03:44 PM
Last Post: bowlofred
  Optmized way to rewrite this very slow code liva28 0 1,499 Jul-18-2021, 12:16 PM
Last Post: liva28
  Combining outputs into a dataframe rybina 0 1,687 Mar-15-2021, 02:43 PM
Last Post: rybina
  ONE input => THREE outputs Tricia279 6 2,645 Jan-14-2021, 08:52 AM
Last Post: perfringo
  Multi set string inputs/outputs kwmcgreal 2 2,083 Sep-26-2020, 10:44 PM
Last Post: kwmcgreal

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020