CAS CS 111 Lecture Notes - Lecture 12: Playstation 3, List Comprehension

129 views12 pages
Verified Note

Document Summary

Max(values): returns the largest value in a list of values. Min(values): returns the smallest value in a list of values: list of lists. Recall that elements of a list can themselves be lists: When you apply max()/min() to a list of lists, the comparisons are based on the first element of each sublist: finding a maximum stock price. To determine the month in which the max occurred, use a list of lists: problem solving using lcs and lists of lists. Here"s a function that works for an arbitrary list of words: finding the best scrabble word. A scrabble_score() function like the one from ps2. Form a lists of lists using a list comprehension. Use max() to get the best [score, word] sublist: Use indexing to extract the word: bestpair[1: best_word(, how would your complete this function, ascii - american standard code for information interchange. Strings are sequences of characters - "hello" Individual characters are actually stored as integers.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions