COMPSCI 1MD3 Lecture Notes - Lecture 3: String Literal, Tuple, Substring

68 views3 pages

Document Summary

Comments - explanatory comments that will not be executed. Bool is another scalar object type in python with two possible values: true and false. Double checking to see if both sides are equal. A way of grouping together a sequence of operations under a common name so we can refer to it multiple times later. This is similar to mathematical functions: cos, exp, log, etc. Boolean functions description a == b a <= b a < b a >= b a > b a != b see if both sides are equal. Tuple- an immutable list of objects, which can be any type, are 0-indexed, created using () e. g t = (4,7. 0,true,potato) Reads out the 1st entry in the tuple. Is true if x is an element in the tuple t, is false otherwise x not in t returns true if x is not in the tuple t, is false otherwise.

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