def test_cheltuieli_dupa_suma_si_zi(): l = setUp() x = cheltuieli_dupa_suma_si_zi(l, 150, 3) assert(len(x) == 1) x = cheltuieli_dupa_suma_si_zi(l, 180, 4) assert(len(x) == 2) x = cheltuieli_dupa_suma_si_zi(l, 30, 5) assert(len(x) == 0)
def test_cheltuieli_dupa_suma_si_zi(): l = setUp() x = cheltuieli_dupa_suma_si_zi(l, 150, 3) assert (len(x) == 1) x = cheltuieli_dupa_suma_si_zi(l, 180, 4) assert (len(x) == 2) x = cheltuieli_dupa_suma_si_zi(l, 30, 5) assert (len(x) == 0)
def ui_cheltuieli_dupa_suma_si_zi(l, undolist): suma = 0 zi = 0 try: zi = int(input("Ziua: ")) suma = int(input("Suma: ")) except ValueError: print("Ati introdus date gresite") aux = cheltuieli_dupa_suma_si_zi(l, suma, zi) for s in aux: afisare_cheltuiala(s)