0
Hello, I would like to know how I can go through the vector of objects and return the name of the company that has the smallest amount of employees and the name of the company that has the largest capital.
I know there are the commands min() and max() for the lists. But how to return the name of the company that corresponds to the minimum and maximum value attribute?
class Empresa:
def __init__(self,nome,capital,nFuncionarios):
self.nome = nome
self.capital = capital
self.nFuncionarios = nFuncionarios
class EmpresaDemo():
empresa = Empresa(['Teste Corporation','Teste Ltda','Teste & Cia','Teste transportes','Teste Tech'],[1000000,900700,505000,30022,405045],[777,30,40,22,1])
min(empresa.nFuncionarios) # Me retorna apenas o item que possui valor mínimo.
max(empresa.capital) # Me retorna apenas o item que possui valor máximo.