Overall Problem
You are playing the game of Monopoly and you decide you wish to construct houses on one of your property groups. The rules of the game require that the number of houses on the properties within each group may not differ by more than one.
You will be given an amount of money to spend, the cost per house, and the number of properties in the group. The goal is to determine how many houses will go on each.
To make the program simple, you may assume that you will not have enough money to build past four houses, so there needs to be no special cases for hotels.
Monopoly Property Groups
Here is a small table relating the colors of the monopoly property groups, the number of properties within the group, and the cost of the houses.
color       size    cost
purple       2       50
light blue   3       50
maroon      3       100
orange      3       100
red            3       150
yellow       3       150
green         3       200
dark blue   2       200

Extra Credit Option
Sometimes there are houses already present, that will be added to.
Allow the user to input the number of houses on each property already.
To simplify the program just let the user input three values. even if there are only two properties in the
group. For example, which colon you be building dark blue

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

# variable to store colors
colors = ['purple', 'light blue', 'maroon', 'orange', 'red', 'yellow', 'green', 'dark blue']
# variable to store sizes
sizes = [2, 3, 3, 3, 3, 3, 3, 2]
# variable to store costs
costs = [50, 50, 100, 100, 150, 150, 200, 200]
# prompt user for color
color = input("Which color block will you be building on? ")
# prompt user for budget
budget = int(input("How much money do you have to spend? "))
# find index of color
index = -1
for i in range(len(colors)):
    if colors[i] == color:
       index = i...

By purchasing this solution you'll be able to access the following files:

for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats