Compsci 6/101, Fall 2011, Lab 7

By entering your name/net-id below you indicate you are present for Lab 7 to answer these questions and that you were part of the process that resulted in answers being turned in.

Name: ______________    Net id: _____________ || Name: ______________    Net id: _____________

Name: ______________    Net id: _____________ || Name: ______________    Net id: _____________

SpeedDial

  1. Answer for first paper-pencil problem:
    
    
    
    
    
    
    
    
    
    
    
    
    
  2. Total number of key-presses with no speed-dial: total = sum([ ])
  3. Number of key-presses saved when a six-digit number is dialed 12 times and the number is put in a speed-dial slot? Why?
    
    
    
  4. List with save[i] being key-presses saved: saved =
  5. Which numbers go in speed-dial slots?
    
    
    
    
  6. Creating code for saved_presses: saved_presses =
  7. Last steps to solve APT:
    
    
    
    
    
    
    

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. 2-3 line solution to APT: def getMaximumSubset(words): return len( )