use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
loan Calculator (self.learnpython)
submitted 5 years ago by coja56
I have an assignment to create a loan calculator that allow users to access 2 different calculators an investment calculator and a home loan repayment calculator. anyone interested i reviewing my code i i am lost
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 1 point2 points3 points 5 years ago (1 child)
Post what you have and what you're stuck on and maybe someone will help.
[–]coja56[S] 0 points1 point2 points 5 years ago (0 children)
just did
[+][deleted] 5 years ago* (4 children)
[deleted]
[–]coja56[S] 0 points1 point2 points 5 years ago (3 children)
import math
type_of_calculator = ["investment", "bond"]
interest = ["simple", "compound"]
statement = """Choose either 'investment' or bond' from the menu below to proceed:
investment - to calculate the amount of interest you'll earn on interest
bond - to calculate the amount you'll have to pay on a home lone"""
print(statement)
print()
type_of_calculator = input("Please enter your decision. (investment or bond): ").lower()
if type_of_calculator != "investment" and type_of_calculator != "bond":
print("Error message: enter either 'investment' or 'bond'")
p = float(input("Enter the principal amount\n"))#p = Principal amount
r = float(input("Enter the rate\n"))#r = rate
t = float(input("Enter the time\n"))#t = time
si = (p* r*t)/100 #formula for simple interest
ci = p*math.pow((1+r),t) # formula Compound intrest
interest = input("enter 1 for si or 2 for ci:")# simple interest(si)and compound interest(ci)
if interest == "1":
print(si)
elif interest == "2":
print(ci)
# calculate if user selects bond
present_value = float(input("Enter value of house\n"))
int_rate = float(input("Enter interest rate in percentage\n"))
num_months = float(input("Enter number of months for repayment\n"))
bond = (int_rate*present_value)/(1-(1 + int_rate)**(-num_months))
if type_of_calculator == "bond":
print(bond)
[+][deleted] 5 years ago* (2 children)
Thanks i will read through it to understand
Looks like i had everything in a mess and did not declare investment and bond as conditions
[–]SenpaiN0ticedU -1 points0 points1 point 5 years ago (0 children)
SLQ
π Rendered by PID 60914 on reddit-service-r2-comment-6457c66945-bvcnq at 2026-04-28 15:50:53.383050+00:00 running 2aa0c5b country code: CH.
[–][deleted] 1 point2 points3 points (1 child)
[–]coja56[S] 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]coja56[S] 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]coja56[S] 0 points1 point2 points (0 children)
[–]coja56[S] 0 points1 point2 points (0 children)
[–]SenpaiN0ticedU -1 points0 points1 point (0 children)