CSC108H1 Lecture Notes - Lecture 5: Precondition, System On A Chip

15 views10 pages
School
Course
Professor
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

For example, here is a list of three grades: grades = [80, 90, 70] Like strings, lists can be indexed (this return the element in the list): Lists can also be sliced, using the same notation as for strings (return a sliced list): For example, here are some calls to those built-in functions: For example, here is a list of str: subjects = ["bio", "cs", "math", "history"] Lists can also contain elements of more than one type. For example, a street address can be represented by a list of [int, str]: street_address = [10, "main street"] for loops over list. Similar to looping over the characters of a string, it is possible to iterate over the elements of a list. The general form of a for loop over a list is: for variable in list: body list methods. The table below contains methods that modify lists. Append the items in the list parameter to the list. list. pop([index])

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