Question

Lets use your knowledge of Python functions to simulate how Seattle landlords might evaluate renters. Create a Python program that prompts the user for typical renter information and determines monthly re Like a rental application, your program should prompt the user for the following information: . credit score number of renters . total monthly income . felon (yes or no) . pet (yes or no) . listed monthly rent Based on user responses, your program should use functions to: Determine whether renter is eligible according to these rules: o is not a felon o has a credit score > 579 o has monthly income at least 3x total monthly rent Calculate total monthly rent according to these rules: o if rénter has a pet, add $100 to base rent o apply a 10% discount on base rent if credit score is at least 740 . Calculate down-payment based on these rules: . o first & last months rent o $250 refundable damage deposit
media%2F691%2F691dc69e-be2f-4731-a662-9a
0 0
Add a comment Improve this question Transcribed image text
Answer #1
Let me know if you have any doubt.

Solution:

numRenters=int(input("How many renters? "))
creditScore=int(input("What is your lowest credit score? "))
monthlyIncome=int(input("What is your total monthly income? "))
isFelon=input("Are you a convicted felon? ")
hasPet = input("Do you have a cat or dog? ")
baseRent=int(input("What is the listed rent? "))

if isFelon=='no' and creditScore>579 and monthlyIncome>=3*baseRent:
    totalMonthyRent=baseRent
    if creditScore>=740:
        totalMonthyRent=totalMonthyRent*0.90
    if hasPet=='yes':
        totalMonthyRent=totalMonthyRent+100

    print('Total monthly rent:',totalMonthyRent)
    print('Rent per person:',round(totalMonthyRent/numRenters))
    DownPayment=totalMonthyRent*2+250
    print('Down Payment:',DownPayment)
    print('Payment per person:',round(monthlyIncome/numRenters),2)

else:
    print('you are ineligible renters.')

Sample Output:

IPython console 3 Console 1/A In [7]: runfile(C:/users/vipul/ . spyder-py3/temp . py, How many renters? 4 What is your lowest credit score? 742 What is your total monthly income? 1000 wdir-C:/users/vipul/ . spyder-py3) e you a convicted felon? no Do you have a cat or dog? yes What is the listed rent? 200 Total monthly rent: 280.0 Rent per person: 70.0 Down Payment: 810.0 Payment per person: 250.0 In [8]: runfile(C:/Users/Vipul/.spyder-py3/temp.py, wdir-C:/Users/Vipul/.spyder-py3) How many renters? 4 What is your lowest credit score? 230 What is your total monthly income? 1000 e you a convicted felon? yes Do you have a cat or dog? no What is the listed rent? 200 You are ineligible renters. In [9]:

Add a comment
Know the answer?
Add Answer to:
Let's use your knowledge of Python functions to simulate how Seattle landlords might evaluate renters. Create...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT