Name: [002] Ian Ozsvald
Member: 128 months
Authored: 181 videos
Description: I am the co-founder of ShowMeDo (see, author of `The Screencasting Handbook <>`_ and the founder of the professional screencast production company `ProCasts <>`_: .. image:: ...

Python Beginners - Functions [ID:360]

a series of video-tutorials by Ian Ozsvald

This series teaches you how to define your own functions in Python. We cover how to write functions, argument passing, scoping, gotchas and nested functions.

Video Tutorials

1. Overview (Functions)

This series covers Functions in Python 2.5 for new Python programmers. In 30 minutes you'll learn how to write your own functions, easy ways to pass many arguments, ways to avoid some common problems and some advanced usage with nested and private functions.

2. Defining a Function

Here we start by looking at the simplest Hello World function in Python. Note that the naming convention is for lowercase and underscores and that docstrings are recommended. Python functions are 'first class' (see wikipedia link below), this means that we can assign them to variables and pass them around - you may not have seen this if you come from a C++/Java background. Links: naming conventi [...]

3. Arguments and Return Values 1

Building your code one line at a time at the command line is a common development approach. Here we build a simple piece of code and then build it into a function, adding features one step at a time. This is the easiest way to approach building larger functions from simple ideas.

4. Arguments and Return Values 2

Passing arguments in to a function and returning values is the usual way that we pass data around for processing. Here we look at a few ways of getting data into and out of our function. We also look at a common error that will save you from making the same mistake.

5. Variable Scope

The scope for variables is important - variables can only be 'seen' in their correct scope. New programmers might find this a bit confusing, these examples should make the basic scope rules of Python clear. We use three examples to show how scope works, how masking works (which you want to avoid) and how globals can be used to change the scope rules. I also explain why global should be avoided. [...]

6. Nested and Private Functions

Calling one function from another is the same as calling a function from anywhere in the program, like we've already seen. Functions often call other functions, this is the way we write modular code which is both easy to debug and to extend. We might also want to write private functions which indicate to other programmers that they shouldn't use the function externally. We might also want to ne [...]

Showmedo is a peer-produced video-tutorials and screencasts site for free and open-source software (FOSS)- with the exception of some club videos, the large majority are free to watch and download.

how to help » about » faq »

Educating the Open-source Community With Showmedo

Although as important as the software it supports, education and documentation are relatively neglected in the Open-source world. Coders love to code, and explaining how best to use or improve the software tends to be deferred or even sidelined.

At Showmedo we believe the community can play a vital role here and also say thanks for the tools and software that make our lives easier. If you have a piece of software you love or a programming langugage you are enthusiastic about, why not make a screencast showing others how to use it? All the stuff you wish you'd been told, the tips, tricks, insights that would have saved you time and frustration.

Screencasting is easier than you think, and we're happy to help you. You can emailus for advice or just use some of the how-to screencasts on the site. This screencasting learning-pathis a good place to start.

Kudos and Thanks for Ian

3 Minute Oveview (What Does Python Look Like?)

simple and informative. you draw me in
70 months ago

Learning Paths

This series lies on the following learning-paths. Learning-paths are a new initiative at Showmedo, to start structuring our content better. You can find out more here.



Showmedo's development is fairly rapid and bugs will inevitably creep in. If you have any problems please drop us a line using the contact address below. Likewise, any suggestions for improvements to the site are gratefully received.