CSC148H1 Lecture Notes - Lecture 15: List Comprehension

108 views5 pages
13 Mar 2018
School
Course
Professor
katrinasavvy and 38715 others unlocked
CSC148H1 Full Course Notes
1
CSC148H1 Full Course Notes
Verified Note
1 document

Document Summary

References: all code seen in the pictures can be found on the csc148 website: http://www. teach. cs. toronto. edu/~csc148h/winter. Make sure all rows are valid and complete: coding the helper functions. Make sure each element in digit_set occurs exactly once: coding the helper function"s helpers. Make sure all columns are valid: helper function. Return a list of all the columns: Make sure all the subsquares are valid: Take the sum of the following lists: use sum. To sum a nested list, used a list comprehension since sum doesn"t work on nested lists. Function sum_list that adds all the numbers in a nested list: shouldn"t ignore built-in sum. Except sum wouldn"t work properly on nested lists: make list-comprehension of sum_lists. However, some of the list elements are numbers and not lists. Returns sum of all the integers in a list. Function must be defined before it can be called. Once g(n) was defined, the function worked. To understand recursion, trace from simple to complex.

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

Related Questions