8
In java we have the operator not, we can use it like this:
if (!metodo()) {
//código
}
I’m just meeting python now, and I’m having a little trouble:
I have a function that adds names to a list:
def adiciona_perfis():
quantidade = 0
nome = raw_input("Digite seu nome ")
nomes.append(nome)
quantidade += 1
And another that checks the quantity variable:
def tem_vaga(quantidade):
if quantidade == 3:
return False
return True
I wanted to call the tem_vaga() function inside the addi_profiles function. But using not, in Java for example, I could do so:
if (!tem_vaga(quantidade)) {
//Código
}
How can I do this in Python?
Naldson, if any of the answers helped resolve the question, mark it as accepted by clicking the arrow below the chosen answer score!
– stderr