def rand(lst):
	"returns a random element in list or integer"
	if type(lst)==type([]):
		return lst[int(random()*len(lst))]
	elif type(lst)==type(0):
		return int(random()*lst)
	else:
		raise Exception,"don't know what do do with type %s!!!"%type(lst)
returns a random element in list or integer
recipes/Python/576505_Sudoku_solvercreator/recipe-576505.py