CSC108H1 Study Guide - Comprehensive Final Exam Guide - Vowel, Test Cricket, String Theory

327 views69 pages
20 Nov 2018
School
Course
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

Where an element can be of any data type. Lists are non-homogenous items = [ 12, abc", [ a", e", i"], 35. 765 ] int str list of str float. Like in many other programming languages, indices in python begin from 0 example_list = [1, 2, 3, 4, 5] x = example_list[0] y = example_list[1] Calling on an element in this list will produce an index error: Python shell, prompt 7, line 1 builtins. indexerror: list index out of range. In python, unlike in many other languages, lists elements can be called from the end. This allows us to access the last element of a list without knowing the length of the list. Changes can be made to a list element"s value. Suppose we want to change the 4th element l[3] . Point to a different memory location (ie. store a different. However, doing this will not overwrite the value stored in the memory location where 0 stored.

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