strip()
lstrip()
rstrip()
trim()
{1, 2, 3}
[1, 2, 3]
{}
(1, 2, 3)
Row 1
Column 2
Element at row 1, column 2
Entire second row
Dictionary keys must be mutable
Dictionary values must be immutable
Dictionary reserves insertion order only in Python 2
Dictionary keys must be unique
Output of the code:
t = (10, 20, 30) t += (40,) print(t)
(10, 20, 30)
(10, 20, 30, 40)
Error
(40,)
What is the output?
s = "Python" print(s[-1:-4])
hon
hon in reverse
IndexError
Empty string
Index of 'a'
Frequency of 'a'
Boolean
What is the output of following?
lst = [1, 2, 3, 4] print(lst[::-1])
[1, 2, 3, 4]
[4, 3, 2, 1]
[1, 3]
a = [1, 2, 3] b = a b.append(4) print(a)
[4]
{1:'a', 2:'b'}
{2:'b'}
{1:'c', 2:'b'}
Sorts array
Reverses array
Deletes elements
Returns copy only
s[1:4]
s[1:3]
s[2:5]
s[1:5:2]