19
18
17
Error
Strings can be modified using indexing.
Strings are immutable.
Strings can only contain alphabetic characters.
Strings must end with a newline character.
capitalize()
startswith()
pop()
find()
insert()
append()
extend()
add()
It returns None.
It raises an IndexError
It creates a new element at that index.
It returns an empty list.
empty_tuple = ()
empty_tuple = tuple()
empty_tuple = []
Both A and B
t1=1,2,4
t1=(1,)
t1=tuple(“123”)
All of these
(1)
(1,)
[1]
{1}
index()
remove()
('abc’)
('a', 'b', 'c’)
['a', 'b', 'c’]
count()
len()
Slicing
Concatenation
Deletion of elements
Iteration
keys()
getkeys()
allkeys()
keyvalues()
A collection of ordered and mutable data
A collection of unordered and mutable data with key-value pairs
A collection of immutable key-value pairs
A collection of values only
Returns None
Throws a KeyError
Creates a new key with a default value
Crashes the program
Clears all key-value pairs
Updates a specific key
Merges another dictionary into the current one
Removes all values
copy = list(original)
copy = original[:]
copy = original.copy()
All of the above
What is the output when we execute
list("hello") ?
['h', 'e', 'l', 'l', 'o']
[' hello']
['llo']
['olleh']
list
set
tuple
dictionary
Tuple
Integer
String
List