Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if __name__ == "__main__":
- class Building:
- def __init__(self):
- self.type()
- self.rooms()
- self.namerooms(self.num_rooms)
- def type(self):
- while True:
- self.building_type = (input('Enter building type (house/business): ')).lower()
- if self.building_type not in ('house', 'business', 'building'):
- print('Incorrect building type! Please enter again.')
- continue
- else:
- break
- def rooms(self):
- while True:
- self.num_rooms = int(input('Enter the number of rooms: '))
- if self.building_type == 'house' and self.num_rooms > 10:
- print('A house cannot have more than 10 rooms!')
- continue
- else:
- break
- def namerooms(num_rooms):
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement