Compsci 101, Fall 2014, Lab 7
Answer the following questions on the online google form for lab 7.
Part 1: 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 =
- One line solution to APT:
def getMaximumSubset(words):
return len( )
ChocolateBar
-
Write
str_unique
.
- How to solve ChocolateBar, what will be hard?
Hangman
- Function header for
process_letter
with types noted:
- Code to implement
process_letter
(body of the function)
- Value of
knowledge
?
- Value of
knowledge
after the code executes?
- Explain in words what
knowledge
represents.
- Code to Display list-of-lists with underscores (or guessed letters)