Thursday, May 2, 2024

BCA PART B 10. Create Array using NumPy and Perform Operations on Array

 


import numpy as np

arr = np.arange(1,11)
print(arr)

# returns the sum of the numbers
print(arr + arr)
# returns the diff between the numbers
print(arr - arr)
# returns the multiplication of the numbers
print(arr * arr )
# the code will continue to run but shows an error
print(arr / arr )

No comments:

Post a Comment