Write a short Python program that takes two arraysaandbof lengthn
storing int values, and returns the dot product ofaandb. That is, it returns
an arraycof lengthnsuch thatc[i] =a[i] ·b[i], fori= 0, . . . ,n−1.
Give an example of a Python code fragment that attempts to write an element
to a list based on an index that may be out of bounds. If that index
is out of bounds, the program should catch the exception that results, and
print the following error message:
“Don’t try buffer overflow attacks in Python!”
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here