000001 Lecture Notes - Tuple, Json

8 views2 pages
20 Mar 2023
Department
Course
Professor

Document Summary

A list is a collection of ordered data. A tuple is an ordered collection of data. A dictionary is an unordered collection of data that stores data in key-value pairs. Sets are mutable and have no duplicate elements. Dictionaries are mutable and keys do not allow duplicates. The append() method adds a single item at the end of the list without modifying the original list. The pop() method removes the item at the given index from the list and returns it. The sort() method sorts the elements of a given list in a specific ascending or descending order. index() searches for a given element from. An element cannot be added to the tuple as it is immutable. The set add() method adds a given element to a set. Dictionaries are enclosed in curly brackets in the form of key-value pairs. The update() method updates the dictionary with the specified key- value pairs.

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

Related Questions