I need to program a Monopoly game for my high school programming class. This is part of the code I'm working on then I'm going to implement it into the rest of my code. I'm expecting it to ask the input (brownhouse1), but when I run it I get nothing for the output. There's probably something really simple wrong with it but I can't figure out what's causing it to output nothing.
I've tried messing with the operators, changing the house values and it will output nothing, I'm not sure what I need to change. (Also sorry for the bad formatting, first time using stackoverflow.)
Thank you!
class Properties:
def __init__(self,name,qprice,qrent,owner,ownername,color,house):
self.name = name
self.price = int(qprice)
self.rent = int(qrent)
self.owner = owner
self.ownername = ownername
self.color = color
self.house = int(house)
MeditaranianAve = Properties("MeditaranianAve",60,2,"Yes","Player2","Brown",0)
BalticAve = Properties("Baltic Ave",60,4,"Yes","Player2","Brown",1)
Brown = (MeditaranianAve, BalticAve)
if MeditaranianAve.ownername and BalticAve.ownername == "Player2":
if MeditaranianAve.house and BalticAve.house <= 4:
brownhouse1 = input("Would you like to buy a house? ")
if brownhouse1 == "y":
if BalticAve.house > MeditaranianAve.house:
Med1 = input("You own more houses on Baltic Ave than Meditaranian Ave, you can only purchase a house for Meditaranian Ave, would you like to purchase? y/n?")
if Med1 == "y":
MeditaranianAve.house = MeditaranianAve.house+1
if MeditaranianAve.house > BalticAve.house:
Balt1 = input("You own more houses on Meditaranian Ave than Baltic Ave, you can only purchase a house for Baltic Ave, would you like to purchase? y/n?")
if Balt1 == "y":
BalticAve.house = BalticAve.house+1