Informatics Practices
Which operator can be used with list?
- in
- not in
- Both 1 & 2
- Arithmetic Operators only
Python List Manipulation
3 Likes
Answer
Both 1 & 2
Reason — The operators in
and not in
can both be used with lists in Python. The in
operator checks if an element is present in the list, while the not in
operator checks if an element is not present in the list.
Answered By
3 Likes
Related Questions
The list L1 contains [3, 4, 5, 6, 6, 8, 0]. What will be the output of the following expression?
print(L1 [-1])
- 0
- 3
- 5
- 8
Which of the following statements is correct about list?
- List can contain values of mixed data types.
- List can contain duplicate values.
- A list with no elements is called an empty list.
- All of these
Which of the following commands will create a list?
- List1=list ()
- List1= []
- List1=[1,2,3,"a"]
- All of these
What is the use of append() function in list?
- It adds an item to the end of the list.
- It adds an item at the beginning of the list.
- It adds an item anywhere in the list.
- All of these