Compsci 101, Fall 2014, Lab 9

Part 1: Top 1000/.csv

  1. What do you see?
    
    
    
    
  2. What are the differences when you say to show 200 words instead of 50?
    
    
    
    
    
  3. Purpose of parameters delimeter and quotechar:
    
    
    
    
    
    
  4. Purpose of d[artist] = []?
    
    
    
    
    
    
  5. Explain the purpose both in terms of what the list comprehension below does and in how it fits with the other lines/list comprehensions in determining the top 30 artists.
       tosort = [(len(t[1]),t[0]) for t in info]
    
    
    
    
    
    
    
    
    
    What's the purpose of the slice info[-30:]?
    
    
    
    
    
    
    What are the top 5 artists?
    
    
    
    
    

    Part 2: SpeedDial

  6. Answer for first paper-pencil problem:
    
    
    
    
    
    
    
    
    
    
    
    
    
  7. Total number of key-presses with no speed-dial: total = sum([ ])
  8. 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?
    
    
    
  9. List with save[i] being key-presses saved: saved =
  10. Which numbers go in speed-dial slots?
    
    
    
    
  11. Creating code for saved_presses: saved_presses =
  12. Last steps to solve APT:
    
    
    
    
    
    
    

    Part 3: MemberCheck

  13. What are the contents (words) of cheat1?
    
    
    
    
  14. Three (two more) list variables
    
    
    
    
  15. Based on previous variables:
       return sorted(                                                       )
    

    Part 4: Customer Statistics

  16. Unique, sorted names on one line:
    
    
    
    
    
    
    
  17. Finished APT on paper.