CSC 498 Lecture Notes - Lecture 6: Difference Set, Empty Set, Concatenation

18 views30 pages

Document Summary

Dictionary: dictionary data type, a dictionary is a collection of key: value pairs. Insertion order of the key-value pairs; python 3. 6 keeps the insertion order: dictionary vs. List: a list is a mapping from an integer index to an element, the unique id of each person is an index, the information of a person is scattered in three lists, the lists are "connected" by indexes. Set in math: a set is an unordered collection of distinct objects, the objects of a set are called elements, examples. Set1 = {3, 5, 6, 7, 1} = {1, 3, 5, 6, 7} Set data type: a set is an unordered collection of objects. {} is not an empty set: set() to create an empty set, element insertion order is not preserved (python) If the element already exists, then it does nothing: remove an element from a set with remove(element), discard(element), or pop() remove(x) removes an element from a set.

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