Create a 2D list with total prices for each house (sale price + repair price) – write function total to perform this task #2.
NO PLAGIARISM AT australianwritingacademy.com/
#The program will read budget limit, number of cities to look for the #house and the number of houses in each city. #Assume, that it will be the same amount of houses in each city.#The program will generate the integer price for each house, in $1000 #All prices will be stored in 2-D list. One row of 2-D list stores prices #for one city.#In addition, the program will generate the integer repair price for each #house, in $1000. #All repair prices will be stored in 2-D list. One row of 2-D list stores #repair prices for one city.#The program will also create 1D list of city names #The person would be able to purchase the house if the total price (sale price plus repair price) #equal or below the budget limit#THE PROGRAM MUST DO THE FOLLOWING:#1. Create a 2D list with total prices for each house (sale price + repair price) – write function total to perform this task #2. Count the number of suitable houses in each city and store the results in 1D list – write function count_house to perform this task#PROGRAM OUTPUT:#1. 2d list of total prices#2. The number of suitable houses in each city. PRINT NAME OF THE CITY ALONG WITH NUMBER OF HOUSES#The program is partially written for you. Complete the program #Program 2: (10 points) Continue the program above to create a 2d list of #prices of suitable houses in each city. Pay attention, this 2d list#might have various number of items in each row so you cannot print it in #the table format. #Example – pay attention all data is in $1000 (for example, price 50 means $50,000:#budget: 50#2 cities 4 houses#city_names={“chester”, “philadelphia”}#sale prices:#50 25 16 7#67 45 23 72#repair prices:#12 23 11 23#1 5 4 4#Output:#total prices#62 48 27 30#68 50 27 76#counters:#[3, 2]#can buy 3 houses in chester and 2 houses in philadelphia#for the second part the output:#[[48, 27, 30], [50, 27]]import random def make_2d_list(row, col, min, max):a = [[ 0 for i in range(col)] for j in range(row)] for i in range(row):for j in range(col):a[i][j]=random.randint(min, max)return adef print_table(my_list_2d, row, col): for i in range(row):print(my_list_2d[i])def make_list_string(size):my_list=[]print(“enter”, size, “strings”)for i in range(size):word= input(“”)my_list.append(word)return my_list#complete the following functionsdef main():#complete the program to find:#1. 2d list of total prices#2. 1d list of counters (number of suitable houses in each citybudget=int(input(“enter budget limit “))row=int(input(“enter number of cities “))col=int(input(“enter number of houses in each city “))sale_price=make_2d_list(row, col, 1, 100)print(“sale prices are “) print_table(sale_price, row, col)repair_price=make_2d_list(row, col, 1, 25)print(“repair prices are “)print_table(repair_price, row, col)city_names= make_list_string(row)print(“city names”)print(city_names)#complete the programmain()
PLACE THIS ORDER OR A SIMILAR ORDER WITH LITE ESSAYS TODAY AND GET AN AMAZING DISCOUNT
The post Create a 2D list with total prices for each house (sale price + repair price) – write function total to perform this task #2. appeared first on .
WE WRITE QUALITY PAPERS FOR A+ RESULTS. NO PLAGIARISM..!!
The post Create a 2D list with total prices for each house (sale price + repair price) – write function total to perform this task #2. appeared first on AUSTRALIAN ACADEMICS.
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
