Bing uses a quadtree-based addressing scheme to come up with a single number (or all-digit string) as the address of a tile. Each digit/character (starting from left / most significant) identifies the branch to take along the tree, starting from the root node. This gives one digit per (slippy-map) zoomlevel:
[![](https://i.stack.imgur.com/wF7P7.jpg)](https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system?redirectedfrom=MSDN)  

(source: [s-msft.com](https://i-msdn.sec.s-msft.com/dynimg/IC96238.jpeg))

Google Maps, OpenStreetMap and others use the ZXY addressing scheme, where a tile is identified by 3 numbers:

* the (slippy-map) zoomlevel (`z`, not to be confused with a z-coordinate like elevation)
* the 0-based count of the tile from left (western) edge to the right (east) (`x`)
* the 0-based count of the tile from upper (northern) edge down (south) (`y`)

Determining the `z` from a quadtree address is trivial, but how do I calculate `x` and `y` of the ZXY scheme from a quadtree address? I'm using Python.