CAS CS 111 Lecture Notes - Lecture 9: 5,6,7,8, Boolean Expression, List Comprehension

52 views2 pages
cherryberry1035 and 38883 others unlocked
CAS CS 111 Full Course Notes
48
CAS CS 111 Full Course Notes
Verified Note
48 documents

Document Summary

He then tells the person behind him that he is the first, and then that person take the number and plus one then pass it back until it reaches you. >>> 30 map(function, sequence) take a list of values and apply them to the function. list(map(triple, python")) [ python", python", python"] list turn into a list for me. [ ppp", yyy" , , nnn"] list comprehension with boolean expressions. [expression for variable in sequence if boolean] boolean expression means something that gives you true or false. [1 for x in [4, 5, 6, 7, 8] if x % 4 == 0] 1, 1 sum([1 for x in [4, 5, 6, 7, 8] if x % 4 == 0]) 2 how many things in the list meet a certain criteria when combining sum and list comprehension using the expression of [1 for ]

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents