Object arrays are not currently supported

292    Asked by ranjan_6399 in Python , Asked on Apr 13, 2021
I am using code:
def front_back(a, b):
 # +++your code here+++
  if len(a) % 2 == 0 && len(b) % 2 == 0:
    return a[:(len(a)/2)] + b[:(len(b)/2)] + a[(len(a)/2):] + b[(len(b)/2):] 
  else:
    #todo! Not yet done. 
  return
I'm getting an error in the IF conditional. What am I doing wrong?

Answered by Ranjana Admin

 Simply use the keyword' and in place of && operator.


Note: By using && in Python you may get a SyntaxError is that there is no && operator in Python. As some of the operators you may know from other languages have a different name in Python.



Your Answer

Interviews

Parent Categories