Devices indexing doesn't work on python3

Fixed it.
But I'am not sure if device indexing feature is good, it's pretty implicit,
and asking for 'iphone' when my first device is macbook or iPad is confusing :smile: 
But it's everywhere in examples, so maybe it should stay