def maybe_ord(x):
    """If x is a string of length 1, return the ascii value.  If it's a
    longer string, return an iterator of values.  Otherwise, coerce it
    to an int()
    >>> maybe_ord('A')
    65
    >>> tuple(maybe_ord('lol'))
    (108, 111, 108)
    >>> maybe_ord(242)
    242
    >>> maybe_ord(242.2222)
    242
    """
    try:
        if len(x) is 1 and len(x[0]) is 1:
            return ord(x)
        else:
            return itertools.imap(maybe_ord, x)
    except:
        return int(x)
If x is a string of length 1, return the ascii value.  If it's a
    longer string, return an iterator of values.  Otherwise, coerce it
    to an int()
    >>> maybe_ord('A')
    65
    >>> tuple(maybe_ord('lol'))
    (108, 111, 108)
    >>> maybe_ord(242)
    242
    >>> maybe_ord(242.2222)
    242
    
recipes/Python/578319_bubblebabble/recipe-578319.py