('abc’)
('a', 'b', 'c’)
['a', 'b', 'c’]
Error
count()
len()
index()
find()
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
if (x > 0):
if x > 0
if x > 0 then:
Both A and B
To create an infinite loop.
To check additional conditions when the first if condition is False.
To end the if block.
To execute code unconditionally.
sequence()
range()
list()
loop()
It skips the current iteration and goes to the next iteration.
It terminates the loop entirely
It does nothing.
It restarts the loop.
Exits the loop entirely.
Skips the rest of the code in the current iteration and moves to the next iteration.
Restarts the loop.
Causes an error.
To execute if the loop terminates normally without a break.
To execute after every iteration..
To handle errors in the loop.
To terminate the loop.
Only the first condition is checked.
All conditions are checked, even if one is True.
It behaves the same as if-elif.
It raises an error.
exit
break
continue
stop
Iterating over a list.
Iterating over a string.
Iterating over a dictionary.
None of the above
The loop runs indefinitely.
The loop executes once before terminating.
The loop does not execute.
It raises an error