# welcome to softhunt.net
# Python program explaining
# left_shift() function
import numpy as np
num = 3
bit_shift_num = 2
print ("Input number : ", num)
print ("Number of bit shift : ", bit_shift_num )
ans = np.left_shift(num, bit_shift_num)
print ("After left shifting 2 bit : ", ans)
# welcome to softhunt.net
# Python program explaining
# left_shift() function
import numpy as np
arr = [21, 15, 43]
bit_shift_arr =[2, 3, 4]
print ("Input array : ", arr)
print ("array of bit shift : ", bit_shift_arr )
ans = np.left_shift(arr, bit_shift_arr)
print ("After left shifting 2 bit : ", ans)
# welcome to softhunt.net
# Python program explaining
# right_shift() function
import numpy as np
arr = [21, 15, 43]
bit_shift_arr =[2, 3, 4]
print ("Input array : ", arr)
print ("array of bit shift : ", bit_shift_arr )
ans = np.right_shift(arr, bit_shift_arr)
print ("After right shifting 2 bit : ", ans)