Tuple operations in Python