1

I was trying to add two tuples two create a new sort of nested tuple using the coerce function of python.

I'm using python version 3.7 which is showing that the function isn't defined.

It is supposed to be a built-in function in python

eyllanesc
  • 235,170
  • 19
  • 170
  • 241

2 Answers2

0

You don't need coerce:

In [16]: t1 = (1,2)                                                                                                                                                                                                                                                                                                           

In [17]: t2 = (3,4)                                                                                                                                                                                                                                                                                                           

In [18]: t1 + t2                                                                                                                                                                                                                                                                                                              
Out[18]: (1, 2, 3, 4)
inspectorG4dget
  • 110,290
  • 27
  • 149
  • 241
0

No, because in Python 2, it only worked to coerce numeric types to be compatible, and it won't contribute to helping create a nested tuple or do anything aside from element-level conversions.

More importantly, it no longer exists.

nanofarad
  • 40,330
  • 4
  • 86
  • 117