Computer Science

What will be the output of the following Python code?

tp = (5)  
tp1 = tp * 2   
print(len(tp1))  
  1. 0
  2. 2
  3. 1
  4. Error

Python Tuples

17 Likes

Answer

Error

Reason — tp is not a tuple and holds an integer value hence object of type 'int' has no len()

Answered By

1 Like


Related Questions