Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. if __name__ == "__main__":
  2.  
  3.     class Building:
  4.  
  5.         def __init__(self):
  6.             self.type()
  7.             self.rooms()
  8.             self.namerooms(self.num_rooms)
  9.            
  10.            
  11.  
  12.         def type(self):
  13.             while True:
  14.                
  15.                 self.building_type = (input('Enter building type (house/business): ')).lower()
  16.                 if self.building_type not in ('house', 'business', 'building'):
  17.                     print('Incorrect building type! Please enter again.')
  18.                     continue
  19.                 else:
  20.                     break
  21.  
  22.         def rooms(self):
  23.             while True:
  24.                 self.num_rooms = int(input('Enter the number of rooms: '))
  25.                 if self.building_type == 'house' and self.num_rooms > 10:
  26.                    
  27.                     print('A house cannot have more than 10 rooms!')
  28.                     continue
  29.                 else:
  30.                     break
  31.         def namerooms(num_rooms):
  32.             pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement