Python's equivalent of && (logical-and) in an if-statement
Here's my 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. :P return I'm getting an error in the IF conditional. What am I doing wrong? You would want and instead of && . David Titarenco Python uses and and or conditionals. i.e. if foo == 'abc' and bar == 'bac' or zoo == '123': # do something Two comments: Use and and or for logical operations in Python. Use 4 spaces to indent instead of 2. You will thank yourself later because your code will look pretty