replacement covered in sraw_input input old input eval(input() xrange range file open (and io module classes next __next__called by next( __getslice__ __getitem__ passed slice ob __setslice__ __setitem__ passed slice ob reduce functools reduce (or loop code execfile(filenameexec(open(file nameread() exec open(filenameexec(open(file nameread() print xy print(xy print >fxy print(xyfile= print xyprint(xyend=' 'ccc(back in 'ccc 'bbbfor byte strings 'bbb raise ev raise ( except exexcept as def ((ab))def ( )(abx file xreadlines for line in file(or =iter(file) keys()etc as lists list( keys()(dictionary views map()range()etc as lists list(map())list(range() map(nonezip (or manual code to pad results = keys() sort(sorted( (or list( keys()) cmp(xy( ( __cmp__(y__lt____gt____eq__etc __nonzero__ __bool__ __hex__x __oct__ __index__ sort comparison functions use key=transform or ject ject (built-insreverse=true fourth edition python changes