Basic Python Program-3

Write a program to create byte type array, read, modify and display the elements of the array.


elements =[10,20,30,45,67]
x=bytearray(elements)
print("Original byte array")
for i in x: print(i)
x[0]=33
x[1]=55

print("Modified byte array")
for i in x: print(i)