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
- Answer for first paper-pencil problem:
- Total number of key-presses with no speed-dial:
total = sum([ ])
- 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?
- List with
save[i]
being key-presses saved:
saved =
- Which numbers go in speed-dial slots?
- Creating code for
saved_presses
:
saved_presses =
- Last steps to solve APT:
AnagramFree
- Use sets:
foods = ["bagel", "bagel", "cheese", "bagel", "hummus" "onion", "bagel", "onion"]
diff =
- What's the value of the list comprehension below (write it out):
[sorted(w) for w in ['cow', 'dog', 'ant', 'bat']]
- Sorted strings:
words = ["eat", "aet", "tea", "bat", "tab", "ode", "doe"]
unique =
- 2-3 line solution to APT:
def getMaximumSubset(words):
return len( )