print ord("a") 97 print ord("b") 98 print ord("A") 65 print ord("$") 36 print ord("\n") 10 x = range(5) print x [0, 1, 2, 3, 4] x = range(2,7) print x [2, 3, 4, 5, 6] x = range(4,19,3) print x [4, 7, 10, 13, 16] for x in range(4): print "hello" hello hello hello hello a = "here is a really long sentence of words in class".split() print a ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] for word in a: print a ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] ['here', 'is', 'a', 'really', 'long', 'sentence', 'of', 'words', 'in', 'class'] for word in a: print word here is a really long sentence of words in class for word in range(len(a)): print word 0 1 2 3 4 5 6 7 8 9 for index in range(len(a)): print index 0 1 2 3 4 5 6 7 8 9 print range(len(a)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for index in range(len(a)): print index, a[index] 0 here 1 is 2 a 3 really 4 long 5 sentence 6 of 7 words 8 in 9 class g = list("Go DUke") print g ['G', 'o', ' ', 'D', 'U', 'k', 'e'] h = " ".join(g) print h G o D U k e h = "".join(g) # join with empty string print h Go DUke