and in python if code example

Example 1: or statement python

if x==1 or y==1:
  print(x,y)

Example 2: python if and

if foo == 'abc' and bar == 'bac' or zoo == '123':
  # do something

Example 3: or in if statement python

weather == "Good!" or weather == "Great!": 

# Or the following  

weather in ("Good!", "Great!"):

Example 4: how to do if= python

#if you are doing this
if X=1
#Do this
if X==1

Example 5: if with && in python

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