HW06

.pdf

School

Harvard University *

*We aren’t endorsed by this school

Course

2396

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

7

Uploaded by agentjake7

Report
HW06.py Test failed: False is not true
dict str list 'vanilla' 'Vanilla' >>> restaurants = { "Cold Stone" : ( "Cookies n Cream" , "Vanilla" ), "Dairy Queen" : ( "vanilla" , "chocolate" , "coffee" ), "Steak n Shake" : ( "Peanut Butter" ,) } >>> flavor = "Vanilla" >>> milkshakes(restaurants, flavor) [ 'Cold Stone' , 'Dairy Queen' ] >>> restaurants = { "Olive Garden" : ( "Vanilla" ,), "McDonalds" : ( "Vanilla-Chocolate Swirl" , "Double Chocolate" ), "Chick-Fil-A" : ( "Frozen Lemonade" ,) } >>> flavor = "Frozen Lemonade" >>> milkshakes(restaurants, flavor) [ 'Chick-Fil-A' ] list str dict
"a" < "b" == True >>> words = [ "abracadabra" , "ambidextrous" , "amphibian" , "astronaut" , "frog" ] >>> letter = "d" >>> letterCounter(words, letter) { 'abracadabra' : 8 , 'ambidextrous' : 2 , 'amphibian' : 3 , 'astronaut' : 2 , 'frog' : 0 } >>> words = [ "rainbow" , "bloom" , "sunny" , "moon" , "trees" ] >>> letter = "p" >>> letterCounter(words, letter) { 'rainbow' : 5 , 'bloom' : 5 , 'sunny' : 2 , 'moon' : 4 , 'trees' : 2 } list list tuple
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help