Answer to Question #147686 in Python for Joseph Se
1. Which of the following is the correct output for the code given below?
import numpy as np
old = np.array([[1, 1, 1], [1, 1, 1]])
new = old
new[0, :2] = 0
print(old)
A. [[1 1 1 ] [ 1 1 1]]
B. [[0 0 1] [ 1 1 1]]
C. [[0 1 1] [ 0 1 1]]
D.[[1 1 0] [ 1 1 0]]
2.
import re
s = 'ACBCAC'
For the given string, which of the following regular expressions can be used to check if the string starts with 'AC'?
A. re.findall('[^A]C', s)
B. re.findall('^[AC]', s)
C. re.findall('^AC', s)
D.re.findall('AC', s)
1
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
Python
Comments
Leave a comment