-
-
Save IndhumathyChelliah/82cc222a767cb1c19889c9ed9e68c043 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
a1=np.array([1,2,3]) | |
a2=np.array([4,5,6]) | |
print (a1+a2) | |
#Output:[5 7 9] | |
print (a1*3) | |
#Output:[3 6 9] | |
print (a1*a2) | |
#Output:[ 4 10 18] | |
b1=[1,2,3] | |
b2=[4,5,6] | |
#Concatenation | |
print (b1+b2) | |
#Output:[1, 2, 3, 4, 5, 6] | |
#Repetition | |
print (b1*3) | |
#Output:[1, 2, 3, 1, 2, 3, 1, 2, 3] | |
print (b1*b2) | |
#Output:TypeError: can't multiply sequence by non-int of type 'list' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment