CSE 1010 Lecture Notes - Fall 2018 Lecture 4 - Assignment (computer science)
CSE 1010 verified notes
4/29View all
Document Summary
Cse 1010 - introduction to computer science and engineering. A list is a compound data type. Contains values of other types of data. A way to store more than one value in a given variable. Also known as a data structure (it gives your data some structure) It is a way to associate values together. >>> squares = [1, 4, 9, 16, 25] Indexing means accessing single elements in a list. Lists are indexed by using a 0-based subscript. Indices: 0 1 2 3 4 (make this into a chart based on slides) The legal subscripts (indexes) go from 0 up to the length of the list (minus 1, because it starts at 0) You can use len( ) to calculate the length of that list. If you use an index number that is greater than the amount of values in that index, then it will return with an index error.