Compsci 101, Fall 2014, Lab 7

Answer the following questions on the online google form for lab 7.

Part 1: AnagramFree

  1. Use sets: foods = ["bagel", "bagel", "cheese", "bagel", "hummus" "onion", "bagel", "onion"] diff =
  2. What's the value of the list comprehension below (write it out): [sorted(w) for w in ['cow', 'dog', 'ant', 'bat']]
  3. Sorted strings: words = ["eat", "aet", "tea", "bat", "tab", "ode", "doe"] unique =
  4. One line solution to APT: def getMaximumSubset(words): return len( )


    ChocolateBar

  5. Write str_unique.
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
  6. How to solve ChocolateBar, what will be hard?
    
    
    
    
    
    
    
    
    
    
    
    
    
    


    Hangman

  7. Function header for process_letter with types noted:
    
    
    
    
    
    
  8. Code to implement process_letter (body of the function)
    
    
    
    
    
    
    
    
    
    
    
    
  9. Value of knowledge?
    
    
    
  10. Value of knowledge after the code executes?
    
    
    
  11. Explain in words what knowledge represents.
    
    
    
    
    
  12. Code to Display list-of-lists with underscores (or guessed letters)