相关疑难解决方法(0)

Python在if语句中等同于&&(logical-and)

这是我的代码:

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. :P
  return
Run Code Online (Sandbox Code Playgroud)

我在IF条件中遇到错误.我究竟做错了什么?

python if-statement keyword logical-operators and-operator

769
推荐指数
7
解决办法
186万
查看次数