<jupyter_start><jupyter_text>**Build Company Class **
Below, we want to build up some classes from scratch. We'll describe the attributes and methods that each class should have available, and ask that you come up with the classes.  **1. Let's build a Company class, used to represent some company (Riyadh Tea Co., <NAME>, Chipotle, etc.).**<jupyter_code>class Company :

  def __init__ (self ,name , industry_type, num_employees, total_revenue):
    self.name=name #  name of the company
    self.industry_type=industry_type #  what industry the company belongs to
    self.num_employees=num_employees #  the number of employees the company has
    self.total_revenue=total_revenue #  the total revenue of the company


  def serve_customer(self, cost ):  #  this method will take in a `float` that is equal to the cost of serving some customer, and then adjust the `total_revenue` by that cost.
    self.total_revenue =cost*self.num_employees
    print('The total revenue is : ' , self.total_revenue)
    
  
 
  
  def gain_employees(self , new_employees):    # this method will take in a `list` that contains new employees that the company has just brought on
    number=len(new_employees)
    self.num_employees+=number #  update the `num_employees` attribute to take account
    print ('the number of emploees is : ',self.num_employees)





a =Company('Riyadh Tea Co ', 'e-comircal', 50 ,5000000) # here we defind an entity from company class 

a.serve_customer(1000)
a.gain_employees(['hailah', 'Rahaf'])<jupyter_output>The total revenue is :  52000
the number of emploees is :  54<jupyter_text>**2. Let's build a TV class, used to represent a television**<jupyter_code>class TV :
  def __init__ (self ,brand , on_status, current_channel, life_perc):
    self.brand=brand  # `brand` - `str` holding the brand of the television ('Sony', 'LG', etc.)
    self.on_status =on_status #  `on_status` - `bool` holding whether or not the television is on. This should default to False (e.g. off). 
    self.current_channel=current_channel #  `current_channel` - `int` holding the current channel number. If the television is off, then the `current_channel` should be 0. Given that `on_status` defaults to off, what does that mean the `current_channel` should default to?
    self.life_perc=life_perc #   `life_perc` - `float` holding the percentage of life left in the TV This should start out at 100% (i.e. default to 100). 


#hit_power` - this will turn the television on/off, depending on whether it's already on/off (if its on it'll switch it off, and vice versa). We'll add a couple of stipulations with this one: 
#  Each time the television is turned off, it loses a little bit of life - decrease the `life_perc` by 0.01 each time the television is turned off.  
#  Each time the television is turned off the channel should be set to 0. 

  def hit_power (self):
    if (self.on_status==True ):
      self.life_perc=self.life_perc-0.01
      print('Television is  turned on!')

    else :
      print('Television is turned off!')

#* `change_channel` - this will take in an `int` to change the channel to a new one. We'll add a stipulation to this as well: 
#* If the television is not on, but the `change_channel` method is called, print 'Television is not on!'. Otherwise, change the channel to the inputted channel. 

  def change_channel (self,num):
    if (self.on_status==True ):
      self.current_channel=num
      print('Channel now is :', num)


    else :
      print('Television is not on!')
   


b=TV('Sony',True ,15 ,1.0)
b.hit_power()
b.hit_power()
b.change_channel(1)


b=TV('Sony',False ,15 ,1.0)
b.hit_power()
b.change_channel(1)<jupyter_output>Television is turned off!
Television is not on!
{'fraction_non_alphanumeric': 0.08985200845665962, 'fraction_numerical': 0.012156448202959831, 'mean_word_length': 3.644171779141104, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '255560', 'license': 'Apache-2.0', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1150, 'n_words': 459, 'path': 'OptionalAssignment.ipynb', 'repo_name': 'helah20/Python', 'size': '3789'}