class Provider():
     
    def __init__(self, title: str, count: int, text_data_list) -> None:
        self.title = title
        self.count = count
        self.text_data_list = text_data_list
        
    def get_fake_percentage(self) -> float:
        
        count_all = 0
        count_fake = 0
        for text_data in self.text_data_list:
            #print(text_data.provider)
            #print("FAKE" if text_data.is_fake_news else "REAL")
            count_all += 1  
            if text_data.is_fake_news:
                count_fake += 1  
        
        if count_all == 0:  
            return 0.0

        return (count_fake / count_all) * 100
            
            