
Danny E. answered 06/23/22
Former Mid-Level Software Engineer at Microsoft specializing in Python
I'm curious as to what you mean by subtract 3 from A. A is an array. You cannot perform a subtraction operation on an array. If you want to remove 3 from the array, you can do A.remove(3), though keep in mind the results array will be [4, 4, 3, 2, 3, 1, 5, 2] as only one 3 will be removed. If you want to remove ALL 3s from A, you can do A = [i for i in A if i != 3] which will result in [4, 4, 2, 1, 5, 2]. Hope this helps, and please ask for clarifications if needed.