Computer Science

Which of the below given functions cannot be used with nested tuples ?

  1. index( )
  2. count( )
  3. max( )
  4. sum( )

Python Tuples

7 Likes

Answer

sum( )

Reason — For sum( ) function to work, the tuple must have numeric elements. Since nested tuples will have at least one element as tuple so the sum( ) function will raise a TypeError and will not work.

Answered By

2 Likes


Related Questions