Answer to Question #147686 in Python for Joseph Se

Question #147686
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
Expert's answer
2020-11-29T23:46:16-0500
  1. B
  2. C

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS