CSE 1010 Lecture 24: CSE 1010 - Lecture 24 - Lists and Tuples

27 views2 pages
Verified Note

Document Summary

Cse 1010 - introduction to computing for engineers. A list is a collection of values. Values in a list can be changed: A tuple is a collection of values. Values in a tuple can not be changed: Typeerror: tuple" object does not support item assignment. A list is intended for a collection of similar values: temperatures = [65, 67, 74, 68, 61, 59] All of the values in this temperatures list are being referred to a specific temperature. A tuple is intended for different values that are grouped: student = (1002133, keith", kazu", cse", 3) The first item in the tuple can be this student"s id number, then their first name, then their last name, then their major, and then the number of semesters attending a school. When you create a list, python reserves extra space for it in case you need to append values to it.

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