-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignment.py
More file actions
66 lines (62 loc) · 3.57 KB
/
assignment.py
File metadata and controls
66 lines (62 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#lex_auth_012693788748742656146
def calculate_loan(account_number,salary,account_balance,loan_type,loan_amount_expected,customer_emi_expected):
eligible_loan_amount=0
bank_emi_expected=0
eligible_loan_amount=0
#Start writing your code here
#Populate the variables: eligible_loan_amount and bank_emi_expected
if(account_number>999 and account_number<2000):
if(account_balance>=100000):
if(salary>25000 and loan_type=="Car"):
eligible_loan_amount=500000
bank_emi_expected=36
if(customer_emi_expected<=bank_emi_expected and loan_amount_expected<=eligible_loan_amount):
print("Account number:", account_number)
print("The customer can avail the amount of Rs.", eligible_loan_amount)
print("Eligible EMIs :", bank_emi_expected)
print("Requested loan amount:", loan_amount_expected)
print("Requested EMI's:",customer_emi_expected)
else:
print("The customer is not eligible for the loan")
elif(salary>50000 and (loan_type=="Car" or loan_type=="House")):
eligible_loan_amount=6000000
bank_emi_expected=60
if(customer_emi_expected<=bank_emi_expected and loan_amount_expected<=eligible_loan_amount):
print("Account number:", account_number)
print("The customer can avail the amount of Rs.", eligible_loan_amount)
print("Eligible EMIs :", bank_emi_expected)
print("Requested loan amount:", loan_amount_expected)
print("Requested EMI's:",customer_emi_expected)
else:
print("The customer is not eligible for the loan")
elif(salary>75000 and (loan_type=="Car" or loan_type=="House" or loan_type=="Business")):
eligible_loan_amount=7500000
bank_emi_expected=84
if(customer_emi_expected<=bank_emi_expected and loan_amount_expected<=eligible_loan_amount):
print("Account number:", account_number)
print("The customer can avail the amount of Rs.", eligible_loan_amount)
print("Eligible EMIs :", bank_emi_expected)
print("Requested loan amount:", loan_amount_expected)
print("Requested EMI's:",customer_emi_expected)
else:
print("The customer is not eligible for the loan")
else:
print("Invalid loan type or salary")
else:
print("Insufficient account balance")
else:
print("Invalid account number")
#Use the below given print statements to display the output, in case of success
#print("Account number:", account_number)
#print("The customer can avail the amount of Rs.", eligible_loan_amount)
#print("Eligible EMIs :", bank_emi_expected)
#print("Requested loan amount:", loan_amount_expected)
#print("Requested EMI's:",customer_emi_expected)
#Use the below given print statements to display the output, in case of invalid data.
#print("Insufficient account balance")
#print("The customer is not eligible for the loan")
#print("Invalid account number")
#print("Invalid loan type or salary")
# Also, do not modify the above print statements for verification to work
#Test your code for different values and observe the results
calculate_loan(1001,40000,250000,"Car",300000,30)