CS 0008: Fall 2015 Lab 8 YOUR NAME: YOUR PARTNER'S NAME: To get credit on this lab, attend recitation, work with your partner to answer the questions, and give "reasonable" (if not all correct) answers. Each of you should hand in a hardcopy of your own solution, due at the beginning of next week's recitation. This lab will give you practice working with dictionaries. First, write down what you think will be printed in the shell. Then, run it to check your answer. >>> birds = {"canada goose":3,"northern fulmar":1} >>> birds["northern fulmar"] * >>> birds.get("northern fulmar") * >>> birds.get("dove",-1) * >>> birds.get("dove",0) * >>> birds["dove"] * >>> for x in birds: ... print(x,birds[x]) ... * * >>> if "dove" in birds: ... del birds["dove"] ... >>> birds * >>> if "canada goose" in birds: ... del birds["canada goose"] ... >>> birds * >>> File birds.txt: Canada Goose Giant Rubber Duck Robin Wren Wren Giant Rubber Duck Robin Robin Robin Hummingbird infile = open("birds.txt",'r') birds = {} for line in infile: # Get rid of the \n at the end name = line.strip() if not name in birds: birds[name] = 1 else: birds[name] += 1 for b in birds: print(b,birds[b]) infile.close() What is the output? (Note: you won't know the order in which the birds are printed) * * * * * Replace the if-then-else statement with one single line. Use dictionary method "get". * *