0

******************************
Sorry guys this works I tested with
bad values

******************************


Hello

I'm having trouble with this function i have a list with dicts and I'm trying to make a search in the list.
The problem is that my function doesn't return the list even though i know the values and types are correct

def dbsearch(db, element, val):
	for x in db:
		if x.get(element) == val:
			return x
		else:
			print "nope not in this one"

Any help or input is apreciated.

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Gribouillis
0

Thats the embarrasing part. The code works fine. It was just my testing that was bad, I used a value that i thought would generate a true but afterwards i realized i should generate a false.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.