Fixed incorrect logic in example python script.