print('''
hello world!
''') pi = "3.14" num = float(pi) weekdays = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] weekdays[0] empty = [] empty2 = list() mytuple = (1.5, "Mon", weekdays) myset = set([1,2,1,3]) myset2 = set(weekdays) myset3 = set('hello') mydictionary = { 1 : "Mon", 2 : "Tue", 3 : "Wed" } emptydict = {} emptydict2 = dict() mydictionary[1] mydictionary[4] = "Thu" if 0 in mydictionary : print ("mydictionary begins with 0") for weekday in weekdays: print (weekday) def square(x): return x*x def nextweekday(n): while True: yield weekdays[n - 7*(n // 7)] n += 1 nextwd = nextweekday(5) print "----------------------------------------" print(nextwd.next()) print(nextwd.next()) print(nextwd.next()) print(nextwd.next()) def print_matches(matchtext): print ("Looking for ", matchtext) while True: line = (yield) if matchtext in line: print (line) matcher = print_matches("215") matcher.next() # initialize matcher matcher.send("ICS 215, Introduction to Scripting") matcher.send("Should not match")