Python With Spyder 3: Functions and Scoping

This is the 3rd in a series of videos providing a tutorial on Python 2.7 using Anaconda Python and the Spyder IDE. Click here to go to a “home page” for the video series.

The topics covered in this video are defining functions and the scope of variables.

The video is about 22 minutes long.

PWS3-DSSThumb

Next Video: Strings, Indexing, and Slicing

Video Index: Functions and Scoping

Click on the topics below to jump to that location in the video.

Time Topic
00:00 Introduction
00:28 Move console to expose Editor window
01:10 Define simple function – “def” statement
01:36 End def statement with colon (“:”)
01:52 Indentation of function code
02:23 “return” statement
02:35 End function code block with blank line
03:07 Run simple function example with F9
03:41 Local variables
06:04 Variable explorer window
06:10 Global variables
06:41 Restart Ipython console (kernal)
07:02 Local variables do not exist at global level
08:28 Use global variables inside functions
09:42 Change global variables inside functions
11:10 “global” statement inside function
12:13 Multiple function arguments
14:28 Missing argument error
15:11 Default argument values
20:44 Summary

Next Video: Strings, Indexing, and Slicing

1 thought on “Python With Spyder 3: Functions and Scoping

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.