Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
What's the equivalent in python for javascript's every()?

I have this code i'm translating from js to python and i have this:

if( this.risultato.every((v, i) => v === this.atteso[i]) ){}

whats the equivalent in python for the every(); function and if it's not builtin how do i create a similar function? For the arrow function part i came onto this solution:

lambda v, i: v == self.atteso[i]
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

the equivalent in python is all function:

mylist = [True, True, True]
x = all(mylist)

Or:

def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True
about 4 years ago · Juan Pablo Isaza Relatório

0

if all(self.risultato[i] == self.atteso[i] for i in len(self.risultato)):

seems like a direct translation. Or,

if all( i==j for (i,j) in zip(self.risultato, self.atteso)):
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda