Python code snippet
Some python code
# ternary
a if condition else b
# string comparision
s1 == s2
# id comparision
a is b # is the id(a) == id(b)
# string find
s.find('sample')
for 'sample' in s
# string replace
s.replace('old', 'new')
s.replace('old', 'new', 3)
# string concatenation
''.join(lst) #list = ['a', 'b', 'c']
# for loop
for letter in 'Python':
print 'Current Letter :', letter
# remove one list in another
l3 = [x for x in l1 if x not in l2]
# remove one list in another(if element are hashable)
set(l1) - set(l2)