News

New paper! in the American Naturalist

Tuesday, July 24, 2018

Python 2 and 3 difference

List of differences between python 2 and 3:

  • print: python2 -- print x, python3 -- print(x)
  • dict: In python2, dict(old_dictionary) creates new dictionary, which is deep copy, i.e., changes in the old and new dictionaries won't affect each other. In python3, need to 'import copy' to create the same deep-copied dictionary, and use copy.deepcopy(old_dictionary)