length x
This is equivalent the Python len function.
i1 : length toPython "Hello, world!" o1 = 13
i2 : length pythonValue "[1,2,3,4,5]" o2 = 5
The source of this document is in /__w/M2/M2/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Python/doc.m2:398:0.