Home  >  Q&A  >  body text

python2代码转换为python3代码

巴扎黑巴扎黑2765 days ago740

reply all(1)I'll reply

  • 黄舟

    黄舟2017-04-17 14:56:54

    First split the code according to the structure:
    '&'.join(List)
    Concatenate the elements in the list into strings with & as intervals.

    params.iteritems() is an iterator

    lambda is an anonymous function. cmp sort.

    Convert to string after sorting.

    Convert to py3:
    The cmp function is no longer used in python3 and can be rewritten.

    reply
    0
  • Cancelreply