CAS CS 111 Lecture Notes - Lecture 10: Higher-Order Function

84 views8 pages
Verified Note

Document Summary

Range (low, high): allows us to work with the range of integers from low to high-1. If you omit low, the range will start at 0. You can think of range as producing a list and in many cases it can be used like one. To see the actual list, we used to use range i conjunction with a nother function called list: Another useful build in function sum(list): computes & returns the sum of a list of numbers. Python treats functions are "first-class citizens" of the language. This means that functions are actually data - and can be treated just like other types of data. Pass a function as an input to another functions. Return a function as the result of another functions. A function that takes another function as input is known as a higher- order function. map() Applies function to each element of sequence and returns the results. You can think of map as producing a list.

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