Podcast
Questions and Answers
What is the output of below python list code ?
list1 = [6, 7, 12, 11, 10, 9]
list2 = list1 * 2
list2[7] = list2[8] + 2
print(list2[-7:-1])
What is the output of below python list code ?
list1 = [6, 7, 12, 11, 10, 9]
list2 = list1 * 2
list2[7] = list2[8] + 2
print(list2[-7:-1])
Which of the following option will produce below output?
list1= [5,20,7,8,1,6,12,36]
output:
[20, 8, 6, 36]
Which of the following option will produce below output?
list1= [5,20,7,8,1,6,12,36]
output:
[20, 8, 6, 36]
Which of the below code contains correct syntax to create 2D array with shape of (3, 4). Assume that “np” is the alias for numpy package.
Which of the below code contains correct syntax to create 2D array with shape of (3, 4). Assume that “np” is the alias for numpy package.
What is the output of below numpy creation code ?
x = np.array([ np.arange(3,12,2), np.arange(4,17,3) ])
print(x)
What is the output of below numpy creation code ?
x = np.array([ np.arange(3,12,2), np.arange(4,17,3) ])
print(x)
Signup and view all the answers
Which of the below option represents the output of the code below:
x= np.array([
[3, 1, 0, 0],
[3, 0, 1, 7],
[4, 1, 2, 3],
[2, 3, 2, 1]])
index=1
z = x[ [index + 1,index], [ index - 1,index] ]
z
Which of the below option represents the output of the code below:
x= np.array([
[3, 1, 0, 0],
[3, 0, 1, 7],
[4, 1, 2, 3],
[2, 3, 2, 1]])
index=1
z = x[ [index + 1,index], [ index - 1,index] ]
z
Signup and view all the answers
What is the output of below code ?
x = np.array([
[12, 12, 7, 14, 2, 3, 4, 4, 13, 1],
[ 7, 2, 5, 6, 14, 10, 3, 12, 7, 11],
[ 1, 6, 9, 13, 14, 3, 10, 4, 5, 4],
[ 2, 8, 1, 3, 7, 3, 1, 5, 7, 12]])
What is the output of below code ?
x = np.array([
[12, 12, 7, 14, 2, 3, 4, 4, 13, 1],
[ 7, 2, 5, 6, 14, 10, 3, 12, 7, 11],
[ 1, 6, 9, 13, 14, 3, 10, 4, 5, 4],
[ 2, 8, 1, 3, 7, 3, 1, 5, 7, 12]])
Signup and view all the answers
Which of the below function(s) returns the maximum element in a given numpy array x ?
Which of the below function(s) returns the maximum element in a given numpy array x ?
Signup and view all the answers
Which of the below code option throws error ?
x = np.array([[1,0], [2,3],[1,2] ])
y = np.array([[10,5,0], [1,0,6], [2,2,0]])
Which of the below code option throws error ?
x = np.array([[1,0], [2,3],[1,2] ])
y = np.array([[10,5,0], [1,0,6], [2,2,0]])
Signup and view all the answers
Which of the value is a valid option for the variable “a” in-order to solve the given linear equation ?
2x + 3y + 2z = 24
x + 3z = 16
x + y = 15
a = _________________________________
np.linalg.solve(a,b)
Which of the value is a valid option for the variable “a” in-order to solve the given linear equation ?
2x + 3y + 2z = 24
x + 3z = 16
x + y = 15
a = _________________________________
np.linalg.solve(a,b)
Signup and view all the answers
What is the output of below numpy arithmetic operation code ?
x = np.array([
[5, 7, 8],
[10, 12, 5],
[4, 1, 0]])
y = np.array([2,5,3])
print( x + y – 2)
What is the output of below numpy arithmetic operation code ?
x = np.array([
[5, 7, 8],
[10, 12, 5],
[4, 1, 0]])
y = np.array([2,5,3])
print( x + y – 2)
Signup and view all the answers