ADVERTISEMENT

Observe the following code and identify what will be the outcome (3)?

8. Observe the following code and identify what will be the outcome?

import numpy as np 

a = np.array([[ 0,  1,  2,  3],
              [ 4,  5,  6,  7],
              [ 8,  9, 10, 11]])
b = a         
b is a
  1. True
  2. False

Answer: A) True

Explanation:

In the above code, the matrix has assigned to the variable a and then copy it to the variable b. Hence, when we will run the code it will print true i.e Boolean value.

Comments and Discussions!




ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.