1
I have to show all register with numeric field filter, I have to choose which numeric field, set lower and upper limit ex.: Show all parts with price >= to 45.50 and price <= to 90.00
I have a code-compliant list:
cadastroPeca = []
item = []
def mostrarCadastro():
print("Cadastro atualizado:\n")
print(cadastroPeca)
print("")
def mostrarCadastro2(lista, filtro1, filtro2):
for i in range(len(lista)):
if i == filtro1 and i == filtro2:
if i >= filtro1 or i <= filtro2:
print(lista)
else:
print("Não possue!")
print("\nFiltro de Pesquisa")
print("1- Código")
print("2- Preço")
print("3- Quantidade")
print("")
mostrarCadastro()
campoEscolhido = input("Escolha o campo que dejesa pesquisar digitando pelo número: ")
if campoEscolhido != "1" and campoEscolhido != "2" and campoEscolhido != "3":
print("\nOpção digitada não existe na lista acima! Por favor, escolha uma das opções abaixo.\n")
campoEscolhido1 = int(campoEscolhido)
if campoEscolhido2 == 1:
print("Opção selecionada: ", campoEscolhido2)
filtroMenor = int(input("Informe o menor valor do item de pesquisa: "))
filtroMaior = int(input("Informe o maior valor do item de pesquisa: "))
I wanted to know what might have been missing in my function to return the values between two variables.