CSE 1010 Lecture Notes - Lecture 19: First Statement

25 views3 pages
jadetortoise401 and 55 others unlocked
CSE 1010 Full Course Notes
84
CSE 1010 Full Course Notes
Verified Note
84 documents

Document Summary

A function should return a correct value or it should not return at all. This does not mean that a function should intentionally get stuck in an unbounded loop. There should be some other means of exiting a function, something that"s outside the normal path of execution. For a long program it is hard to do in the general way. An exception is a way to indicate that something unexpected happened. A function that raises an exception exists, but it does not return through the normal means. Formatting errors warning showed in red color. I want to try something that may fail. Below >>> try: are statements you want to try. We can see that there is an error in c = abc"[3], which is an exception. The orange except means: if an exception occurs i want to intercept it here. For the indexerror, this is the specific exception i want to intercept.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents