Create code that handles error conditions in an elegant and easy-to-read fashion.
- [Instructor] Even when your code is solid … and well written, … your programs will encounter unexpected conditions. … To handle these conditions, … we use something called exception handling. … This is a pretty common feature … of other programming languages, … and Julia provides it as well. … Let's go ahead and open up the exceptions_start file … and you can see that we have some simple code here … that performs a square root calculation. … So there's a variable, and we give it a value. … We call the square root function, and we print the result. … So let's go ahead and run that, … and you can see that the square root of nine is three. … But now let's go back and change that value … to a negative number and then let's save and run it again. … And you can see now that we're getting an error … because you can't perform a square root calculation … on a negative integer number. … You have to call it with a complex argument. … So you can see that we're getting this domain error here. … Now this error causes our program to exit …
- Using the Julia REPL tool
- Differences between Julia and other languages
- Variables and data types
- Numbers in Julia
- Defining and operating on strings
- Using built-in functions in Julia
- Conditional statements
- Using array functions
- String processing
Skill Level Beginner
Python Basics for Java Developerswith Deepa Muralidhar42m 53s Beginner
Programming Foundations: Algorithmswith Joe Marini1h 45m Beginner
What you should know1m 26s
2. Language Basics
3. Language Features
4. Control Structures
5. Data Structures
6. Julia Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.