w+
a
x
r+
2 rows, 3 columns of ones
3 rows, 2 columns of ones
6×6 matrix
1D array
Adjacent indices
First and last, second and second-last, etc.
Random indices
Even indices only
itemsize
nbytes
memory
bytesize
Output of the code:
t = (10, 20, 30) t += (40,) print(t)
(10, 20, 30)
(10, 20, 30, 40)
Error
(40,)
What will be the output?
print(type(()))
<class 'set'>
<class 'dict'>
<class 'tuple'>
Decision-based processing
Sequential processing
Iterative processing with variable update
Randomized processing
What is the output?
s = "Python" print(s[-1:-4])
hon
hon in reverse
IndexError
Empty string
Index of 'a'
Frequency of 'a'
Boolean
.py
.mod
.exe
.txt
What is the output of following?
lst = [1, 2, 3, 4] print(lst[::-1])
[1, 2, 3, 4]
[4, 3, 2, 1]
[1, 3]
Ignored
Compiled only
Executed once
Executed every time
while
do-while
for
if
Syntax error
Logical error
Compilation error
Infinite loop
Lifetime of an object
Region of code where a name is accessible
Size of a variable
Memory address
list
tuple
dictionary
ndarray
x = 5 y = 10 print(x > 3 or y < 5 and x == 5)
True
False
None
1 to n
2 to n-1
1 to √n
2 to √n
int
float
string
depends on user input
What will be the output of the code given below?
import math as m print(m.pi)
3.141592654
math.pi