Question: The powers of 2 ( , , , etc ) arise frequently in computer science. ( For example, you may have noticed that storage on

The powers of 2(
,
,
, etc) arise frequently in computer science. (For example, you may have noticed that storage on smartphones or USBs come in powers of 2, like 16 GB,32 GB, or 64 GB.) Use np.arange and the exponentiation operator ** to compute the first 30 powers of 2, starting from 2^0.
Hint 1: np.arange(1,2**30,1) creates an array with
elements and will crash your kernel.
Hint 2: Part of your solution will involve np.arange, but your array shouldn't have more than 30 elements.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!