Robotics & Artificial Intelligence
Which of the following function is applicable in a tuple?
- insert
- append
- del
- None of these
Python Tuples
1 Like
Answer
del
Reason — A tuple is immutable, so elements cannot be inserted or appended, but the entire tuple can be deleted using the del keyword.
Answered By
2 Likes
Related Questions
A module in Python is …………… .
- A function
- Collection of variables
- Collection of Python code in a file
- None of these
What would be the output of following code ?
list1 = [2, 3, 4, 5, 6] print(list1[-2])- 3
- 4
- 5
- Error
What would be the output of following code?
str1 = "Hello India" s1 = str1[1:3] print(s1)- He
- el
- Hlo
- None of these
What would be the output of following code?
Q1 = "Hello How are you" val = Q1.count("H") print(val)- 1
- 2
- 3
- 4