Python question for the day

:thinking: Hey students! Question for the day!!!
:books: What’s the difference between a list and a numpy array? :bulb::star2: #CodingWonders

1 Like

Numpy arrays use less memory & faster in execution compared to List

1 Like

@prasadbhss That’s great! Can you write a Python script to compare the execution times?

@dkdebarun666

code to check the execution time of Numpy array & list

import time
import numpy as np
start_time = time.time()
‘’’ code for list or numpy ‘’’
final_time = time.time()
print(round((final_time - start_time), 2),‘milliseconds’)