Staging
v0.5.1
https://github.com/python/cpython
Revision 8b907a8875d1b22d8f060dee9430cc82d471e86b authored by Miss Islington (bot) on 18 September 2019, 10:36:35 UTC, committed by Eric V. Smith on 18 September 2019, 10:36:35 UTC
A little change on first paragraph of python tutorial to be more clearly

https://bugs.python.org/issue37904

Automerge-Triggered-By: @ericvsmith
(cherry picked from commit b57481318e3e3cbacd398b898f9849ec8f2d7eec)

Co-authored-by: Diego Alberto Barriga Martínez <diegobarriga@protonmail.com>
1 parent 69b3718
Raw File
Tip revision: 8b907a8875d1b22d8f060dee9430cc82d471e86b authored by Miss Islington (bot) on 18 September 2019, 10:36:35 UTC
bpo-37904: Edition on python tutorial - section 4 (GH-16169) (GH-16235)
Tip revision: 8b907a8
antigravity.py

import webbrowser
import hashlib

webbrowser.open("https://xkcd.com/353/")

def geohash(latitude, longitude, datedow):
    '''Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    '''
    # https://xkcd.com/426/
    h = hashlib.md5(datedow).hexdigest()
    p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
    print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))
back to top