import this a = 3 b = 5 print a**2 + b**2 s = 'HumptyDumptysatonawallHumptyDumptyhadagreatfallAlltheKingshorsesandalltheKingsmenCouldntputHumptyDumptyinhisplaceagain.' a, b, c, d = 22, 27, 97, 102 print s[a:b + 1] + ' ' + s[c:d + 1] a, b = 100, 200 total = 0 for i in range(a, b + 1): if i % 2 == 1: total += i print total sum(i for i in range(a, b + 1) if i % 2 == 1) s = 'We tried list and we tried dicts also we tried Zen' counts = {} for word in s.split(): if word not in counts: counts[word] = 1 else: counts[word] += 1 for word in counts: print word, counts[word] from collections import Counter counts_two = Counter(s.split()) print counts == counts_two