def listeHarIkkeNegativeTall(liste): for tall in liste: if tall < 0: return False return True def sjekkOmNegativt(tall): return tall < 0 liste = [10, 4, 3, 9, 100] # fantNegativt = False # for tall in liste: # if sjekkOmNegativt(tall): # print("NEGATIVT TALL", tall) # fantNegativt = True # # if not fantNegativt: # print("ALLE ER POSITIVE") print(f"listeHarIkkeNegativeTall på listen: {liste} returnerer {listeHarIkkeNegativeTall(liste)}")