These methods work in both Python 2 and 3, with some differences in syntax and behavior.