I&C SCI 33 Lecture Notes - Lecture 8: Init, Relational Operator, Operand

27 views3 pages

Document Summary

__bool__ function on that object to determine whether its boolean equivalent represents true or false. If __bool__ is not defined, python returns len(object) != 0. If there is no __len__, then python just returns true. Interlude: short-circuit logical operators and their real meanings. The operators and/or are called short-circuit operators. This means that they evaluate the left-hand side first, but don"t always evaluate the right-hand side. For example: if x and y:

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