'Iterate over list in Python using for loop

Below is my script in main.py which I was hoping would return "true", but doesn't seem to register anything:

main.py

import config

business_number = int(678)
    
for company in config.companies:
    if int(company.business_id) == business_number:
        print("True")

config.py:

companies: [Company] = [
            Company("ABC", "345", 3.00, 10.00, 200.00),
            Company("DEF", "678", 5.00, 10.00, 500.00)
]

company .py

class Company:
    name = None
    business_id = None
    max_share_price = None
    min_total = None
    max_total = None
    
    def __init__(self, name, business_id, max_share_price, min_total, max_total):
        self.name = name
        self.business_id = business_id
        self.max_share_price = max_share_price
        self.min_total = min_total
        self.max_total = max_total


Solution 1:[1]

To get your correct answer put the following line on the top of the config.py:

from company import Company

Then run main.py again to see your desired answer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Reza K Ghazi