# Non-Programmer's Tutorial for Python 3/More on Lists

We have already seen lists and how they can be used. Now that you have
some more background I will go into more detail about lists. First we
will look at more ways to get at the elements in a list and then we will
talk about copying them.

Here are some examples of using indexing to access a single element of a
list:

`>>> `**`some_numbers = ['zero', 'one', 'two', 'three', 'four', 'five']`**\
`>>> `**`some_numbers[0]`**\
`'zero'`\
`>>> `**`some_numbers[4]`**\
`'four'`\
`>>> `**`some_numbers[5]`**\
`'five'`

All those examples should look familiar to you. If you want the first
item in the list just look at index 0. The second item is index 1 and so
on through the list. However what if you want the last item in the list?
One way could be to use the `len()` function like
`some_numbers[len(some_numbers) - 1]`. This way works since the `len()`
function always returns the last index plus one. The second from the
last would then be `some_numbers[len(some_numbers) - 2]`. There is an
easier way to do this. In Python the last item is always index -1. The
second to the last is index -2 and so on. Here are some more examples:

`>>> `**`some_numbers[len(some_numbers) - 1]`**\
`'five'`\
`>>> `**`some_numbers[len(some_numbers) - 2]`**\
`'four'`\
`>>> `**`some_numbers[-1]`**\
`'five'`\
`>>> `**`some_numbers[-2]`**\
`'four'`\
`>>> `**`some_numbers[-6]`**\
`'zero'`

Thus any item in the list can be indexed in two ways: from the front and
from the back.

Another useful way to get into parts of lists is using slicing. Here is
another example to give you an idea what they can be used for:

`>>> `**`things = [0, 'Fred', 2, 'S.P.A.M.', 'Stocking', 42, "Jack", "Jill"]`**\
`>>> `**`things[0]`**\
`0`\
`>>> `**`things[7]`**\
`'Jill'`\
`>>> `**`things[0:8]`**\
`[0, 'Fred', 2, 'S.P.A.M.', 'Stocking', 42, 'Jack', 'Jill']`\
`>>> `**`things[2:4]`**\
`[2, 'S.P.A.M.']`\
`>>> `**`things[4:7]`**\
`['Stocking', 42, 'Jack']`\
`>>> `**`things[1:5]`**\
`['Fred', 2, 'S.P.A.M.', 'Stocking']`

Slicing is used to return part of a list. The slicing operator is in the
form `things[first_index:last_index]`. Slicing cuts the list before the
`first_index` and before the `last_index` and returns the parts in
between. You can use both types of indexing:

`>>> `**`things[-4:-2]`**\
`['Stocking', 42]`\
`>>> `**`things[-4]`**\
`'Stocking'`\
`>>> `**`things[-4:6]`**\
`['Stocking', 42]`

Another trick with slicing is the unspecified index. If the first index
is not specified the beginning of the list is assumed. If the last index
is not specified the whole rest of the list is assumed. Here are some
examples:

`>>> `**`things[:2]`**\
`[0, 'Fred']`\
`>>> `**`things[-2:]`**\
`['Jack', 'Jill']`\
`>>> `**`things[:3]`**\
`[0, 'Fred', 2]`\
`>>> `**`things[:-5]`**\
`[0, 'Fred', 2]`

Here is a (HTML inspired) program example (copy and paste in the poem
definition if you want):

``` python
poem = ["<B>", "Jack", "and", "Jill", "</B>", "went", "up", "the",
        "hill", "to", "<B>", "fetch", "a", "pail", "of", "</B>",
        "water.", "Jack", "fell", "<B>", "down", "and", "broke",
        "</B>", "his", "crown", "and", "<B>", "Jill", "came",
        "</B>", "tumbling", "after"]

def get_bold(text):
    true = 1
    false = 0
    ## is_bold tells whether or not we are currently looking at
    ## a bold section of text.
    is_bold = false
    ## start_block is the index of the start of either an unbolded
    ## segment of text or a bolded segment.
    start_block = 0
    for index in range(len(text)):
        ## Handle a starting of bold text
        if text[index] == "<B>":
            if is_bold:
                print("Error: Extra Bold")
            ## print "Not Bold:", text[start_block:index]
            is_bold = true
            start_block = index + 1
        ## Handle end of bold text
        ## Remember that the last number in a slice is the index
        ## after the last index used.
        if text[index] == "</B>":
            if not is_bold:
                print("Error: Extra Close Bold")
            print("Bold [", start_block, ":", index, "]", text[start_block:index])
            is_bold = false
            start_block = index + 1

get_bold(poem)
```

with the output being:

`Bold [ 1 : 4 ] ['Jack', 'and', 'Jill']`\
`Bold [ 11 : 15 ] ['fetch', 'a', 'pail', 'of']`\
`Bold [ 20 : 23 ] ['down', 'and', 'broke']`\
`Bold [ 28 : 30 ] ['Jill', 'came']`

The `get_bold()` function takes in a list that is broken into words and
tokens. The tokens that it looks for are `<B>` which starts the bold
text and `</B>` which ends bold text. The function `get_bold()` goes
through and searches for the start and end tokens.

The next feature of lists is copying them. If you try something simple
like:

`>>> `**`a = [1, 2, 3]`**\
`>>> `**`b = a`**\
`>>> `**`print(b)`**\
`[1, 2, 3]`\
`>>> `**`b[1] = 10`**\
`>>> `**`print(b)`**\
`[1, 10, 3]`\
`>>> `**`print(a)`**\
`[1, 10, 3]`

This probably looks surprising since a modification to `b` resulted in
`a` being changed as well. What happened is that the statement `b = a`
makes `b` a *reference* to `a`. This means that `b` can be thought of as
another name for `a`. Hence any modification to `b` changes `a` as well.
However some assignments don\'t create two names for one list:

`>>> `**`a = [1, 2, 3]`**\
`>>> `**`b = a * 2`**\
`>>> `**`print(a)`**\
`[1, 2, 3]`\
`>>> `**`print(b)`**\
`[1, 2, 3, 1, 2, 3]`\
`>>> `**`a[1] = 10`**\
`>>> `**`print(a)`**\
`[1, 10, 3]`\
`>>> `**`print(b)`**\
`[1, 2, 3, 1, 2, 3]`

In this case `b` is not a reference to `a` since the expression `a * 2`
creates a new list. Then the statement `b = a * 2` gives `b` a reference
to `a * 2` rather than a reference to `a`. All assignment operations
create a reference. When you pass a list as an argument to a function
you create a reference as well. Most of the time you don\'t have to
worry about creating references rather than copies. However when you
need to make modifications to one list without changing another name of
the list you have to make sure that you have actually created a copy.

There are several ways to make a copy of a list. The simplest that works
most of the time is the slice operator since it always makes a new list
even if it is a slice of a whole list:

`>>> `**`a = [1, 2, 3]`**\
`>>> `**`b = a[:]`**\
`>>> `**`b[1] = 10`**\
`>>> `**`print(a)`**\
`[1, 2, 3]`\
`>>> `**`print(b)`**\
`[1, 10, 3]`

Taking the slice `[:]` creates a new copy of the list. However it only
copies the outer list. Any sublist inside is still a references to the
sublist in the original list. Therefore, when the list contains lists,
the inner lists have to be copied as well. You could do that manually
but Python already contains a module to do it. You use the `deepcopy`
function of the `copy` module:

`>>> `**`import copy`**\
`>>> `**`a = [[1, 2, 3], [4, 5, 6]]`**\
`>>> `**`b = a[:]`**\
`>>> `**`c = copy.deepcopy(a)`**\
`>>> `**`b[0][1] = 10`**\
`>>> `**`c[1][1] = 12`**\
`>>> `**`print(a)`**\
`[[1, 10, 3], [4, 5, 6]]`\
`>>> `**`print(b)`**\
`[[1, 10, 3], [4, 5, 6]]`\
`>>> `**`print(c)`**\
`[[1, 2, 3], [4, 12, 6]]`

First of all notice that `a` is a list of lists. Then notice that when
`b[0][1] = 10` is run both `a` and `b` are changed, but `c` is not. This
happens because the inner arrays are still references when the slice
operator is used. However with `deepcopy` `c` was fully copied.

So, should I worry about references every time I use a function or `=`?
The good news is that you only have to worry about references when using
dictionaries and lists. Numbers and strings create references when
assigned but every operation on numbers and strings that modifies them
creates a new copy so you can never modify them unexpectedly. You do
have to think about references when you are modifying a list or a
dictionary.

By now you are probably wondering why are references used at all? The
basic reason is speed. It is much faster to make a reference to a
thousand element list than to copy all the elements. The other reason is
that it allows you to have a function to modify the inputted list or
dictionary. Just remember about references if you ever have some weird
problem with data being changed when it shouldn\'t be.


# Non-Programmer's Tutorial for Python 3/Revenge of the Strings

And now presenting a cool trick that can be done with strings:

``` python
def shout(string):
    for character in string:
        print("Gimme an " + character)
        print("'" + character + "'")

shout("Lose")

def middle(string):
    print("The middle character is:", string[len(string) // 2])

middle("abcdefg")
middle("The Python Programming Language")
middle("Atlanta")
```

And the output is:

`Gimme an L`\
`'L'`\
`Gimme an o`\
`'o'`\
`Gimme an s`\
`'s'`\
`Gimme an e`\
`'e'`\
`The middle character is: d`\
`The middle character is: r`\
`The middle character is: a`

What these programs demonstrate is that strings are similar to lists in
several ways. The `shout()` function shows that `for` loops can be used
with strings just as they can be used with lists. The `middle` procedure
shows that that strings can also use the `len()` function and array
indexes and slices. Most list features work on strings as well.

The next feature demonstrates some string specific features:

``` python
def to_upper(string):
    ## Converts a string to upper case
    upper_case = ""
    for character in string:
        if 'a' <= character <= 'z':
            location = ord(character) - ord('a')
            new_ascii = location + ord('A')
            character = chr(new_ascii)
        upper_case = upper_case + character
    return upper_case

print(to_upper("This is Text"))
```

with the output being:

`THIS IS TEXT`

This works because the computer represents the characters of a string as
numbers from 0 to 1,114,111. For example \'A\' is 65, \'B\' is 66 and א
is 1488. The values are the unicode value.
Python has a function called `ord()` (short for ordinal) that returns a
character as a number. There is also a corresponding function called
`chr()` that converts a number into a character. With this in mind the
program should start to be clear. The first detail is the line:
`if 'a' <= character <= 'z':` which checks to see if a letter is lower
case. If it is then the next lines are used. First it is converted into
a location so that a = 0, b = 1, c = 2 and so on with the line:
`location = ord(character) - ord('a')`. Next the new value is found with
`new_ascii = location + ord('A')`. This value is converted back to a
character that is now upper case. Note that if you really need the upper
case of a letter, you should use `u=var.upper()` which will work with
other languages as well.

Now for some interactive typing exercise:

`>>> `**`# Integer to String`**\
`>>> `**`2`**\
`2`\
`>>> `**`repr(2)`**\
`'2'`\
`>>> `**`-123`**\
`-123`\
`>>> `**`repr(-123)`**\
`'-123'`\
`>>> `**`# String to Integer`**\
`>>> `**`"23"`**\
`'23'`\
`>>> `**`int("23")`**\
`23`\
`>>> `**`"23" * 2`**\
`'2323'`\
`>>> `**`int("23") * 2`**\
`46`\
`>>> `**`# Float to String`**\
`>>> `**`1.23`**\
`1.23`\
`>>> `**`repr(1.23)`**\
`'1.23'`\
`>>> `**`# Float to Integer`**\
`>>> `**`1.23`**\
`1.23`\
`>>> `**`int(1.23)`**\
`1`\
`>>> `**`int(-1.23)`**\
`-1`\
`>>> `**`# String to Float`**\
`>>> `**`float("1.23")`**\
`1.23`\
`>>> `**`"1.23"`**` `\
`'1.23'`\
`>>> `**`float("123")`**\
`123.0`

If you haven\'t guessed already the function `repr()` can convert an
integer to a string and the function `int()` can convert a string to an
integer. The function `float()` can convert a string to a float. The
`repr()` function returns a printable representation of something. Here
are some examples of this:

`>>> `**`repr(1)`**\
`'1'`\
`>>> `**`repr(234.14)`**\
`'234.14'`\
`>>> `**`repr([4, 42, 10])`**\
`'[4, 42, 10]'`

The `int()` function tries to convert a string (or a float) into an
integer. There is also a similar function called `float()` that will
convert an integer or a string into a float. Another function that
Python has is the `eval()` function. The `eval()` function takes a
string and returns data of the type that python thinks it found. For
example:

`>>> `**`v = eval('123')`**\
`>>> `**`print(v, type(v))`**\
`123 <type 'int'>`\
`>>> `**`v = eval('645.123')`**\
`>>> `**`print(v, type(v))`**\
`645.123 <type 'float'>`\
`>>> `**`v = eval('[1, 2, 3]')`**\
`>>> `**`print(v, type(v))`**\
`[1, 2, 3] <type 'list'>`

If you use the `eval()` function you should check that it returns the
type that you expect.

One useful string function is the `split()` method. Here\'s an example:

`>>> `**`"This is a bunch of words".split()`**\
`['This', 'is', 'a', 'bunch', 'of', 'words']`\
`>>> `**`text = "First batch, second batch, third, fourth"`**\
`>>> `**`text.split(",")`**\
`['First batch', ' second batch', ' third', ' fourth']`

Notice how `split()` converts a string into a list of strings. The
string is split by whitespace by default or by the optional argument (in
this case a comma). You can also add another argument that tells
`split()` how many times the separator will be used to split the text.
For example:

`>>> `**`list = text.split(",")`**\
`>>> `**`len(list)`**\
`4`\
`>>> `**`list[-1]`**\
`' fourth'`\
`>>> `**`list = text.split(",", 2)`**\
`>>> `**`len(list)`**\
`3`\
`>>> `**`list[-1]`**\
`' third, fourth'`

### Slicing strings (and lists)

Strings can be cut into pieces --- in the same way as it was shown for
lists in the previous chapter --- by using the *slicing* \"operator\"
`[]`. The slicing operator works in the same way as before:
text\[first_index:last_index\] (in very rare cases there can be another
colon and a third argument, as in the example shown below).

In order not to get confused by the index numbers, it is easiest to see
them as *clipping places*, possibilities to cut a string into parts.
Here is an example, which shows the clipping places (in yellow) and
their index numbers (red and blue) for a simple text string:

`<tt>`{=html}

  -------- ---- ----- --- --- --- --- --- ------ --- ---- --- ---- --- ----- ----
                0         1       2       \...       -2       -1
                ↓         ↓       ↓       ↓          ↓        ↓        ↓
  text =   \"         S       T       R          I        N        G         \"
                ↑                                                      ↑
                \[:                                                    :\]
  -------- ---- ----- --- --- --- --- --- ------ --- ---- --- ---- --- ----- ----

`</tt>`{=html}

Note that the red indexes are counted from the beginning of the string
and the blue ones from the end of the string backwards. (Note that there
is no blue -0, which could seem to be logical at the end of the string.
Because `-0 == 0`, -0 means \"beginning of the string\" as well.) Now we
are ready to use the indexes for slicing operations:

`<tt>`{=html}

  -------------- --- ------------
  text\[1:4\]    →   \"TRI\"
  text\[:5\]     →   \"STRIN\"
  text\[:-1\]    →   \"STRIN\"
  text\[-4:\]    →   \"RING\"
  text\[2\]      →   \"R\"
  text\[:\]      →   \"STRING\"
  text\[::-1\]   →   \"GNIRTS\"
  -------------- --- ------------

`</tt>`{=html}

`text[1:4]` gives us all of the `text` string between clipping places 1
and 4, \"`TRI`\". If you omit one of the \[first_index:last_index\]
arguments, you get the beginning or end of the string as default:
`text[:5]` gives \"`STRIN`\". For both `first_index` and `last_index` we
can use both the red and the blue numbering schema: `text[:-1]` gives
the same as `text[:5]`, because the index -1 is at the same place as 5
in this case. If we do not use an argument containing a colon, the
number is treated in a different way: `text[2]` gives us one character
following the second clipping point, \"`R`\". The special slicing
operation `text[:]` means \"from the beginning to the end\" and produces
a copy of the entire string (or list, as shown in the previous chapter).

Last but not least, the slicing operation can have a second colon and a
third argument, which is interpreted as the \"step size\": `text[::-1]`
is `text` from beginning to the end, with a step size of -1. -1 means
\"every character, but in the other direction\". \"`STRING`\" backwards
is \"`GNIRTS`\" (test a step length of 2, if you have not got the point
here).

All these slicing operations work with lists as well. In that sense
strings are just a special case of lists, where the list elements are
single characters. Just remember the concept of *clipping places*, and
the indexes for slicing things will get a lot less confusing.

### Examples

``` python
# This program requires an excellent understanding of decimal numbers.
def to_string(in_int):
    """Converts an integer to a string"""
    out_str = ""
    prefix = ""
    if in_int < 0:
        prefix = "-"
        in_int = -in_int
    while in_int // 10 != 0:
        out_str = str(in_int % 10) + out_str
        in_int = in_int // 10
    out_str = str(in_int % 10) + out_str
    return prefix + out_str

def to_int(in_str):
    """Converts a string to an integer"""
    out_num = 0
    if in_str[0] == "-":
        multiplier = -1
        in_str = in_str[1:]
    else:
        multiplier = 1
    for c in in_str:
        out_num = out_num * 10 + int(c)
    return out_num * multiplier

print(to_string(2))
print(to_string(23445))
print(to_string(-23445))
print(to_int("14234"))
print(to_int("12345"))
print(to_int("-3512"))
```

The output is:

`2`\
`23445`\
`-23445`\
`14234`\
`12345`\
`-3512`


# Non-Programmer's Tutorial for Python 3/File IO

### File I/O

Here is a simple example of file I/O (input/output):

``` python
# Write a file
with open("test.txt", "wt") as out_file:
    out_file.write("This Text is going to out file\nLook at it and see!")

# Read a file
with open("test.txt", "rt") as in_file:
    text = in_file.read()

print(text)
```

The output and the contents of the file `test.txt` are:

`This Text is going to out file`\
`Look at it and see!`

Notice that it wrote a file called `test.txt` in the directory that you
ran the program from. The `\n` in the string tells Python to put a
*n*ewline where it is.

An overview of file I/O is:

-   Get a file object with the `open` function
-   Read or write to the file object (depending on how it was opened)
-   If you did not use `with` to open the file, you\'d have to close it
    manually

The first step is to get a file object. The way to do this is to use the
`open` function. The format is `file_object = open(filename, mode)`
where `file_object` is the variable to put the file object, `filename`
is a string with the filename, and `mode` is `"rt"` to *r*ead a file as
*t*ext or `"wt"` to *w*rite a file as *t*ext (and a few others we will
skip here). Next the file objects functions can be called. The two most
common functions are `read` and `write`. The `write` function adds a
string to the end of the file. The `read` function reads the next thing
in the file and returns it as a string. If no argument is given it will
return the whole file (as done in the example).

Now here is a new version of the phone numbers program that we made
earlier:

``` python
def print_numbers(numbers):
    print("Telephone Numbers:")
    for k, v in numbers.items():
        print("Name:", k, "\tNumber:", v)
    print()

def add_number(numbers, name, number):
    numbers[name] = number

def lookup_number(numbers, name):
    if name in numbers:
        return "The number is " + numbers[name]
    else:
        return name + " was not found"

def remove_number(numbers, name):
    if name in numbers:
        del numbers[name]
    else:
        print(name," was not found")

def load_numbers(numbers, filename):
    in_file = open(filename, "rt")
    while True:
        in_line = in_file.readline()
        if not in_line:
            break
        in_line = in_line[:-1]
        name, number = in_line.split(",")
        numbers[name] = number
    in_file.close()

def save_numbers(numbers, filename):
    out_file = open(filename, "wt")
    for k, v in numbers.items():
        out_file.write(k + "," + v + "\n")
    out_file.close()

def print_menu():
    print('1. Print Phone Numbers')
    print('2. Add a Phone Number')
    print('3. Remove a Phone Number')
    print('4. Lookup a Phone Number')
    print('5. Load numbers')
    print('6. Save numbers')
    print('7. Quit')
    print()

phone_list = {}
menu_choice = 0
print_menu()
while True:
    menu_choice = int(input("Type in a number (1-7): "))
    if menu_choice == 1:
        print_numbers(phone_list)
    elif menu_choice == 2:
        print("Add Name and Number")
        name = input("Name: ")
        phone = input("Number: ")
        add_number(phone_list, name, phone)
    elif menu_choice == 3:
        print("Remove Name and Number")
        name = input("Name: ")
        remove_number(phone_list, name)
    elif menu_choice == 4:
        print("Lookup Number")
        name = input("Name: ")
        print(lookup_number(phone_list, name))
    elif menu_choice == 5:
        filename = input("Filename to load: ")
        load_numbers(phone_list, filename)
    elif menu_choice == 6:
        filename = input("Filename to save: ")
        save_numbers(phone_list, filename)
    elif menu_choice == 7:
        break
    else:
        print_menu()

print("Goodbye")
```

Notice that it now includes saving and loading files. Here is some
output of my running it twice:

`1. Print Phone Numbers`\
`2. Add a Phone Number`\
`3. Remove a Phone Number`\
`4. Lookup a Phone Number`\
`5. Load numbers`\
`6. Save numbers`\
`7. Quit`\
\
`Type in a number (1-7): `**`2`**\
`Add Name and Number`\
`Name: `**`Jill`**\
`Number: `**`1234`**\
`Type in a number (1-7): `**`2`**\
`Add Name and Number`\
`Name: `**`Fred`**\
`Number: `**`4321`**\
`Type in a number (1-7): `**`1`**\
`Telephone Numbers:`\
`Name: Jill     Number: 1234`\
`Name: Fred     Number: 4321`\
\
`Type in a number (1-7): `**`6`**\
`Filename to save: `**`numbers.txt`**\
`Type in a number (1-7): `**`7`**\
`Goodbye`

`1. Print Phone Numbers`\
`2. Add a Phone Number`\
`3. Remove a Phone Number`\
`4. Lookup a Phone Number`\
`5. Load numbers`\
`6. Save numbers`\
`7. Quit`\
\
`Type in a number (1-7): `**`5`**\
`Filename to load: `**`numbers.txt`**\
`Type in a number (1-7): `**`1`**\
`Telephone Numbers:`\
`Name: Jill     Number: 1234`\
`Name: Fred     Number: 4321`\
\
`Type in a number (1-7): `**`7`**\
`Goodbye`

The new portions of this program are:

``` python
def load_numbers(numbers, filename):
    in_file = open(filename, "rt")
    while True:
        in_line = in_file.readline()
        if not in_line:
            break
        in_line = in_line[:-1]
        name, number = in_line.split(",")
        numbers[name] = number
    in_file.close()

def save_numbers(numbers, filename):
    out_file = open(filename, "wt")
    for k, v in numbers.items():
        out_file.write(k + "," + v + "\n")
    out_file.close()
```

First we will look at the save portion of the program. First it creates
a file object with the command `open(filename, "wt")`. Next it goes
through and creates a line for each of the phone numbers with the
command `out_file.write(k + "," + v + "\n")`. This writes out a line
that contains the name, a comma, the number and follows it by a newline.

The loading portion is a little more complicated. It starts by getting a
file object. Then it uses a `while True:` loop to keep looping until a
`break` statement is encountered. Next it gets a line with the line
`in_line = in_file.readline()`. The `readline` function will return an
empty string when the end of the file is reached. The `if` statement
checks for this and `break`s out of the `while` loop when that happens.
Of course if the `readline` function did not return the newline at the
end of the line there would be no way to tell if an empty string was an
empty line or the end of the file so the newline is left in what
`readline` returns. Hence we have to get rid of the newline. The line
`in_line = in_line[:-1]` does this for us by dropping the last
character. Next the line `name, number = in_line.split(",")` splits the
line at the comma into a name and a number. This is then added to the
`numbers` dictionary.

### Advanced use of .txt files

You might be saying to yourself, \"Well I know how to read and write to
a textfile, but what if I want to print the file without opening out
another program?\"

There are a few different ways to accomplish this. The easiest way does
open another program, but everything is taken care of in the Python
code, and doesn\'t require the user to specify a file to be printed.
This method involves invoking the subprocess of another program.

Remember the file we wrote output to in the above program? Let\'s use
that file. Keep in mind, in order to prevent some errors, this program
uses concepts from the Next chapter. Please feel free to revisit this
example after the next chapter.

``` Python
import subprocess
def main():
    try:
        print("This small program invokes the print function in the Notepad application")
        #Lets print the file we created in the program above
        subprocess.call(['notepad','/p','numbers.txt'])
    except WindowsError:
        print("The called subprocess does not exist, or cannot be called.")

main()
```

The `subprocess.call` takes three arguments. The first argument in the
context of this example, should be the name of the program which you
would like to invoke the printing subprocess from. The second argument
should be the specific subprocess within that program. For simplicity,
just understand that in this program, `'/p'` is the subprocess used to
access your printer through the specified application. The last argument
should be the name of the file you want to send to the printing
subprocess. In this case, it is the same file used earlier in this
chapter.

### Exercises

Now modify the grades program from section
Dictionaries so that is uses file I/O to
keep a record of the students.


# Non-Programmer's Tutorial for Python 3/Dealing with the imperfect

### \...or how to handle errors

### closing files with with

We use the \"with\" statement to open and close files.[^1][^2]

``` python
with open("in_test.txt", "rt") as in_file:
    with open("out_test.txt", "wt") as out_file:
        text = in_file.read()
        data = parse(text)
        results = encode(data)
        out_file.write(results)
    print( "All done." )
```

If some sort of error happens anywhere in this code (one of the files is
inaccessible, the parse() function chokes on corrupt data, etc.) the
\"with\" statements guarantee that all the files will eventually be
properly closed. Closing a file just means that the file is \"cleaned
up\" and \"released\" by our program so that it can be used in another
program.

### catching errors with try

So you now have the perfect program, it runs flawlessly, except for one
detail, it will crash on invalid user input. Have no fear, for Python
has a special control structure for you. It\'s called `try` and it tries
to do something. Here is an example of a program with a problem:

``` python
print("Type Control C or -1 to exit")
number = 1
while number != -1:
   number = int(input("Enter a number: "))
   print("You entered:", number)
```

Notice how when you enter `@#&` it outputs something like:

`Traceback (most recent call last):`\
` File "try_less.py", line 4, in ``<module>`{=html}\
`   number = int(input("Enter a number: "))`\
`ValueError: invalid literal for int() with base 10: '\\@#&'`

As you can see the `int()` function is unhappy with the number `@#&` (as
well it should be). The last line shows what the problem is; Python
found a `ValueError`. How can our program deal with this? What we do is
first: put the place where errors may occur in a `try` block, and
second: tell Python how we want `ValueError`s handled. The following
program does this:

``` python
print("Type Control C or -1 to exit")
number = 1
while number != -1:
    try:
        number = int(input("Enter a number: "))
        print("You entered:", number)
    except ValueError:
        print("That was not a number.")
```

Now when we run the new program and give it `@#&` it tells us \"That was
not a number.\" and continues with what it was doing before.

When your program keeps having some error that you know how to handle,
put code in a `try` block, and put the way to handle the error in the
`except` block.

### Exercises

Update at least the phone numbers program (in section
Dictionaries) so it doesn\'t crash if a
user doesn\'t enter any data at the menu.
`{{Solution|title=Solution|text=
<syntaxhighlight lang="python">
def print_menu():
    print('1. Print Phone Numbers')
    print('2. Add a Phone Number')
    print('3. Remove a Phone Number')
    print('4. Lookup a Phone Number')
    print('5. Quit')
    print()

numbers = {}
menu_choice = 0
print_menu()
while menu_choice != 5:
    try:
        menu_choice = int(input("Type in a number (1-5): "))
        if menu_choice == 1:
            print("Telephone Numbers:")
            for x in numbers.keys():
                print("Name: ", x, "\tNumber:", numbers[x])
            print()
        elif menu_choice == 2:
            print("Add Name and Number")
            name = input("Name: ")
            phone = input("Number: ")
            numbers[name] = phone
        elif menu_choice == 3:
            print("Remove Name and Number")
            name = input("Name: ")
            if name in numbers:
                del numbers[name]
            else:
                print(name, "was not found")
        elif menu_choice == 4:
            print("Lookup Number")
            name = input("Name: ")
            if name in numbers:
                print("The number is", numbers[name])
            else:
                print(name, "was not found")
        elif menu_choice != 5:
            print_menu()
    except ValueError:
        print("That was not a number.")</syntaxhighlight>

}}`{=mediawiki}

[^1]: \"The \'with\'
    statement\"

[^2]: \'The Python \"with\" Statement by
    Example\'


# Non-Programmer's Tutorial for Python 3/Recursion

## Recursion

In Python, a recursive function is a function which calls itself.

### Introduction to recursion

So far, in Python, we have seen functions which call other functions.
However, it is possible for a function to call itself. Let\'s look at a
simple example.

``` python
# Program by Mitchell Aikens
# No Copyright
# 2010

num = 0

def main():
    counter(num)

def counter(num):
    print(num)
    num += 1
    counter(num)

main()
```

If you were to run this program in IDLE, it would run forever. The only
way to stop the loop would be to interrupt the execution by pressing
Ctrl + C on your keyboard. This is an example of an infinite recursion.
(Some users have reported a glitch in the current IDLE system causing
the exception raised by Ctrl + C to start looping as well. If this
happens, press Ctrl + F6, and the IDLE shell should restart.)

It is arguable that recursion is just another way to accomplish the same
thing as a while loop. In some cases, this is absolutely correct.
Though, there are other uses for Recursion that are very valid, where
`while` loops or `for` loops may not be optimal.

Recursion can be controlled, just like loops. Lets look at an example of
a controlled loop.

``` python
# Program by Mitchell Aikens
# No copyright
# 2012
def main():
    loopnum = int(input("How many times would you like to loop?\n"))
    counter = 1
    recurr(loopnum,counter)

def recurr(loopnum,counter):
    if loopnum > 0:
        print("This is loop iteration",counter)
        recurr(loopnum - 1,counter + 1)
    else:
        print("The loop is complete.")

main()
```

The above uses arguments/parameters to control the number of recursions.
Simply use what you already know about functions and follow the flow of
the program. It is simple to figure out. If you are having trouble,
please refer back to Non-Programmer\'s Tutorial for Python 3/Advanced
Functions
Example.

## Practical Applications of Recursion

Often, recursion is studied at an advanced computer science level.
Recursion is usually used to solve complex problems that can be broken
down into smaller, identical problems. Recursion isn\'t required to
solve a problem. Problems that can be solved with recursion, most likely
can be solved with loops. Also, a loop may be more efficient than a
recursive function. Recursive functions require more memory, and
resources than loops, making them less efficient in a lot of cases. This
usage requirement is sometimes referred to as
`<i>`{=html}overhead`</i>`{=html}. You might be thinking, \"Well why
bother with recursion. I\'ll just use a loop. I already know how to loop
and this is a lot more work.\" This thought is understandable, but not
entirely ideal. When solving complex problems, a recursive function is
sometimes easier, faster, and simpler to build and code.

Think of these two \"rules\":

-   If I can solve the problem now, without recursion, the function
    simply returns a value.
-   If I cannot solve the problem now without recursion, the function
    reduces the problem to something smaller and similar, and calls
    itself to solve the problem.

Let\'s apply this using a common mathematical concept, factorials. If
you are unfamiliar with factorials in mathematics, please refer to the
following reading. Factorials

The factorial of a number `<i>`{=html}n`</i>`{=html}, is denoted as
`<i>`{=html}n!`</i>`{=html}.

Here are some basic rules of factorials.

If n = 0 then n! = 1 If n \> 0 then n! = 1 x 2 x 3 x \... x n

For example, let\'s look at the factorial of the number 9.

9! = 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9

Let\'s look at a program which calculates the factorial of any number
entered by the user, by method of recursion.

``` python3
def main():
    num = int(input("Please enter a non-negative integer.\n"))
    fact = factorial(num)
    print("The factorial of",num,"is",fact)

def factorial(num):
    if num == 0:
        return  1
    else:
        return num * factorial(num - 1)

main()
```

Recursion is also useful in an advanced topic called generators. To
generate the series 1,2,1,3,1,2,1,4,1,2\... we would need this code:

``` python
def crazy(min_):
    yield min_
    g=crazy(min_+1)
    while True:
        yield next(g)
        yield min_

i=crazy(1)
```

to get the next element you would call next(i)


# Non-Programmer's Tutorial for Python 3/Intro to Object Oriented Programming in Python 3

## Object Oriented Programming

Up until now, the programming you have been doing has been procedural.
However, a lot of programs today are Object Oriented. Knowing both
types, and knowing the difference, is very important. Many important
languages in computer science such as C++ and Java, often use OOP
methods.

Beginners, and non-programmers often find the concept of OOP confusing,
and complicated. This is normal. Don\'t be put off if you struggle or do
not understand. There are plenty of other resources you can use to help
overcome any issues you may have, if this chapter does not help you.

This chapter will be broken up into different lessons. Each lesson will
explain OOP in a different way, just to make sure OOP is covered as
thoroughly as possible, because `<b>`{=html}IT IS VERY
IMPORTANT.`</b>`{=html} Before the lessons, there is an introduction
which explains key concepts, terms, and other important areas of OOP,
required to understand each lesson.

## Introduction

Think of a procedure as a function. A function has a specific purpose.
That purpose may be gathering input, performing mathematical
calculations, displaying data, or manipulating data to, from, or in, a
file. Typically, procedures use data which is separate from code for
manipulation. This data is often passed between procedures. When a
program becomes much larger and complex, this can cause problems. For
example, you have designed a program which stores information about a
product in variables. When a customer requests information on a product,
these variables are passed to different functions for different
purposes. Later on, as more data is stored on these products, you decide
to store the information in a list or dictionary. In order for your
program to function, you must now edit each function that accepted
variables, to now accept and manipulate a list or dictionary. Imagine
the time that would take for a program that was hundreds of megabytes,
and hundreds of files in size! It would drive you insane! not to
mention, errors in your code, are almost guaranteed, just because of the
large volume of work and possibilities to make a typo or other error.
This is less than optimal. Procedural programming is centered on
procedures or functions. But, OOP is centered on creating Objects.
Remember how a procedural program has separated data and code? Remember
how that huge program was hundreds of files and would take FOREVER to
edit? Well, think of an `<i>`{=html}object`</i>`{=html} as a sort of
\"combination\" of those files and data into one \"being\". In a
technical sense, an Object is an entity which contains data, AND
procedures (code, functions, etc.).

`<b>`{=html}Data inside an object is called a `<i>`{=html}data
attribute`</i>`{=html}`</b>`{=html}.\
`<b>`{=html}Functions, or procedures inside the object are called
`<i>`{=html}methods`</i>`{=html}`</b>`{=html}.\

Think of `<b>`{=html}data attributes`</b>`{=html} as variables.\
Think of `<b>`{=html}methods`</b>`{=html} as functions or procedures.\
Let\'s look at a simple, everyday example. The light and light switch in
your bedroom. The data attributes would be as follows.

-   light_on (True or False)
-   switch_position (Up or Down)
-   electricity_flow (True or False)

The methods would be as follows.

-   move_switch
-   change_electricity_flow

The data attributes may or may not be visible. For example, you cannot
directly see the electricity flowing to the light. You only know there
is electricity, because the light is on. However, you can see the
position of the switch (switch_position), and you can see if the light
is on or off (light_on). Some methods are
`<i>`{=html}private`</i>`{=html}. This means that you cannot directly
change them. For example, unless you cut the wires in your light fixture
(please don\'t do that, and for the sake of this example, assume that
you don\'t know the wires exist), you cannot change the flow of
electricity directly. You also cannot directly change if the light is on
or off (and no, you can\'t unscrew the bulb! work with me here!).
However, you can indirectly change these attributes by using the
`<i>`{=html}methods`</i>`{=html} in the object. If you don\'t pay your
bill, the `change_electricity_flow` method will change the value of the
`electricity_flow` attribute to FALSE. If you flip the switch, the
`move_switch` method changes the value of the `light_on` attribute.

By now you\'re probably thinking, \"What does this have to do with
Python?\" or, \"I understand, but how do I code an Object?\" Well, we
are almost to that point! One more concept must be explained before we
can dive into code.

In Python, an object\'s data attributes and methods are specified by a
`<b>`{=html}class`</b>`{=html}. Think of a class as a blueprint to an
object. For example, your home - the object that you live in - you can
also call it your pad, bungalow, crib, or whatever, was built based on a
set of blueprints; these blueprints would be considered the class used
to design your home, pad, crib, ahem, you get the idea.

Again, a class tells us how to make an object. In technical terms, and
this is important here, a class defines the data attributes and methods
inside an object.

To create a class, we code a `<i>`{=html}class definition`</i>`{=html}.
A class definition is a group of statements which define an object\'s
data attributes and methods.

`<big>`{=html}`<b>`{=html}Lesson One`</b>`{=html}`</big>`{=html}

Below is a Procedural program that performs simple math on a single
number, entered by a user.

``` python

# Program by Mitchell Aikens
# No Copyright
# 2012

# Procedure 1
def main():
    try:
        # Get a number to maniuplate
        num = float(input("Please enter a number to manipulate.\n"))
        # Store the result of the value, after it has been manipulated
        # by Procedure 2
        addednum = addfive(num)
        # Store the result of the value, after it has been manipulated
        # by Procedure 3
        multipliednum = multiply(addednum)
        # Send the value to Procedure 4
        display(multipliednum)
    # Deal with exceptions from non-numeric user entry
    except ValueError:
        print("You must enter a valid number.\n")
        # Reset the value of num, to clear non-numeric data.
        num = 0
        # Call main, again.
        main()

# Procedure 2
def addfive(num):
    return num + 5

# Procedure 3
def multiply(addednum):
    return addednum * 2.452

# Procedure 4
def display(multi):
    # Display the final value
    print("The final value is ",multi)

# Call Procedure 1
main()
```

If we were to enter a value of \"5\", the output would be as shown
below.

`Please enter a number to manipulate.`\
`5`\
`The final value is  24.52`

If we were to enter a value of \"g\", and then correct the input and
enter a value of \"8\", the output would be as shown below.

`Please enter a number to manipulate.`\
`g`\
`You must enter a valid number.`\
\
`Please enter a number to manipulate.`\
`8`\
`The final value is  31.875999999999998`

Below, is a Class, and a program which uses that class. This Object
Oriented Program does the same thing as the procedural program above.
Let\'s cover some important OOP coding concepts before we dive into the
Class and program. To create a class, we use the `class` keyword. After
the keyword, you type the name you want to name your class. It is common
practice that the name of your class uses CapWords convention. If I
wanted to create a class named dirtysocks, the code would be:

``` python
class DirtySocks
```

The Class is shown first. The program which uses the class is second.

``` python
# Filename: oopexample.py
# Mitchell Aikens
# No Copyright
# 2012
# OOP Demonstration - Class

class NumChange:

    def __init__(self):
        self.__number = 0

    def addfive(self,num):
        self.__number = num
        return self.__number + 5

    def multiply(self,added):
        self.__added = added
        return self.__added * 2.452
```

The program which uses the class above, is below.

``` python
# Filename: oopexampleprog.py
# Mitchell Aikens
# No Copyright
# 2012
# OOP Demonstration - Program

import oopexample

maths = oopexample.NumChange()

def main():

    num = float(input("Please enter a number.\n"))

    added = maths.addfive(num)

    multip = maths.multiply(added)

    print("The manipulated value is ",multip)

main()
```

After looking at that program, you are probably a bit lost. That\'s OK.
Let\'s start off by dissecting the class. The class is named
\"NumChange\" There are three methods to this class:

-   \_\_init\_\_
-   addfive
-   multiply

These three methods each have a similar code.

``` python
def __init__(self):
def addfive(self,num):
def multiply(self,added):
```

Notice how each method has a parameter named \"self\". This parameter
must be present in each method of the class. This parameter doesn\'t
HAVE TO be called \"self\", but it is standard practice, which means you
should probably stick with it. This parameter is required in each method
because when a method executes, it has to know which object\'s
attributes to operate on. Even though there is only one Object, we still
need to make sure the interpreter knows that we want to use the data
attributes in that class. So we play it safe\...and use the \"self\"
parameter.

Let\'s look at the first method.

``` python
def __init__(self):
```

Most Classes in Python have an `__init__` which executes automatically
when an instance of a class is created in memory. (When we reference a
class, an `<i>`{=html}instance`</i>`{=html} \[or object\] of that class
is created.) This method is commonly referred to as the
`<i>`{=html}initializer method`</i>`{=html}. When the method executes,
the \"self\" parameter is automatically assigned to the object. This
method is called the initializer method because is \"initializes\" the
data attributes. ↵Under the \_\_init\_\_ method, we set the value of the
`number` attribute to 0 initially. We reference the object attribute
using dot notation.

``` python
def __init__(self):
    self.__number = 0
```

The `self.__number = 0` line simply means \"\"the value of the attribute
\"number\", in the object, is 0\"\".

Let\'s look at the next method.

``` python
def addfive(self,num):
    self.__number = num
    return self.__number + 5
```

This method is named \"addfive\". It accepts a parameter called \"num\",
from the program using the class. The method then assigns the value of
that parameter to the \"number\" attribute inside the object. The method
then returns the value of \"number\", with 5 added to it, to the
statement which called the method.

Let\'s look at the third method.

``` python
def multiply(self,added):
    self.__added = added
    return self.__added * 2.453
```

This method is named \"multiply\". It accepts a parameter named
\"added\". It assigns the value of the parameter to the \"added\"
attribute, and returns the value of the \"added\" attribute multiplied
by 2.452, to the statement which called the method.

Notice how the name of each method begins with two underscores? Let\'s
explain that. Earlier we mentioned that an object operates on data
attributes inside itself using methods. Ideally, these data attributes
should be able to be manipulated ONLY BY METHODS IN THE OBJECT. It is
possible to have outside code manipulate data attributes. To \"hide\"
attributes, so only methods in the object can manipulate them, you use
two underscores before the object name, as we have been demonstrating.
Omitting those two underscores in the attribute name, allows for the
possibility of manipulation from code outside the object.

Let\'s look at the program which uses the class we just dissected.

Notice the first line of non comment code.

``` python
import oopexample
```

This line of code imports the class, which we have saved in a separate
file (module). Classes do not have to be in a separate file, but it is
almost always the case, and thus is good practice to get used to
importing the module now.

The next line:

``` python
maths = oopexample.NumChange()
```

This line creates an instance of the NumChange class, stored in the
module named \"oopexample\", and stores the instance in the variable
named \"maths\". The syntax is:
`<i>`{=html}`modulename.Classname()``</i>`{=html} Next we define the
main function. Then, we get a number from the user.

The next line `added = maths.addfive(num)` sends the value of the
\"num\" variable to the method named \"addfive\", which is part of the
class we stored an instance of in the variable named \"maths\", and
stores the returned value in the variable named \"added\".

The next line `multip = maths.multiply(added)` sends the value of the
variable \"added\", to the method named \"multiply\", which is part of
the class we stored an instance of in the variable named \"maths\", and
stores the returned value in the variable named \"multip\".

The next line prints \"The manipulated value is
`<value of multip>`{=html}\". The last line calls the main function
which executes the steps outlined above.


# Non-Programmer's Tutorial for Python 3/Intro to Imported Libraries and other Functions

## Intro to Imported Libraries and other Functions

In this chapter, we will cover some functions from various imported
libraries that are commonly asked about, or used in Python. This chapter
is not required to fully understand basics of Python. This chapter is
meant to show further capability of Python, which can be utilized with
what you already know about the language.

### math

:   The math library has many functions that are useful for programs
    that need to perform mathematical operations, that cannot be
    accomplished using the built in operators.

```{=html}
<!-- -->
```

:   This section assumes you have math training up to and including
    Trigonometry.

The following list shows all the functions in the math library:

-   math.ceil
-   math.copysign
-   math.fabs
-   math.factorial
-   math.floor
-   math.fmod (Not the most ideal for its purpose. Will not be
    explained.)
-   math.frexp (Outside the scope of this tutorial. Will not be
    explained.)
-   math.fsum
-   math.isfinite
-   math.isinf
-   math.isnan
-   math.ldexp
-   math.modf (Outside the realm of this tutorial. Will not be
    explained.)
-   math.trunc (Outside the realm of this tutorial. Will not be
    explained.)
-   math.exp
-   math.expm1
-   math.log
-   math.log1p
-   math.log10
-   math.pow
-   math.sqrt
-   math.acos
-   math.asin
-   math.atan
-   math.atan2
-   math.cos
-   math.hypot
-   math.sin
-   math.tan
-   math.degrees
-   math.radians
-   math.acosh
-   math.asinh
-   math.atanh
-   math.cosh
-   math.sinh
-   math.tanh
-   math.erf
-   math.erfc
-   math.gamma
-   math.lgamma
-   math.pi
-   math.e

:   Of course, we won\'t cover every one of these functions. But we will
    cover a good chunk of them.

Let\'s start off by covering the two constants in the math library.
`math.pi` is the mathematical constant \"π\", to available precision on
your computer. `math.e` is the mathematical constant \"e\", to available
precision on your computer. Here is an example of both constants when
entered in interactive mode in the Python shell.

`>>> import math`\
`>>> math.e`\
`<span style="color:blue;">`{=html}`2.718281828459045```{=html}\
`>>> math.pi`\
`<span style="color:blue;">`{=html}`3.141592653589793```{=html}

These constants can be stored in a variable just like any other number.
Below is an example of such, and shows simple operations on those
variables.

`>>> conste = math.e`\
`>>> (conste + 5 / 2) * 2.21`\
`<span style="color:blue;">`{=html}`11.532402840894488```{=html}\
`>>> constpi = math.pi`\
`>>> (((7 /2.1) % constpi) * 2)`\
`<span style="color:blue;">`{=html}`0.38348135948707984```{=html}\
`>>>`

Now, let\'s look at the functions. Let\'s start at the top of the list,
and work our way down. Some of the functions will be skipped. At this
point in the tutorial, you should be able to look at each of these
examples to follow, and easily figure out what the example does. A
simple sentence or two about what the function does will be provided.

Below is an example of every `math` module function, and how it is used.
(Excluding functions noted above as not to be explained)

`>>> import math`\
`>>> math.ceil(4.5) ** Rounds the number up to the nearest non decimal number **`\
`5`\
`>>> math.ceil(4.1)`\
`<span style="color:blue;">`{=html}`5```{=html}\
`>>> math.copysign(4, -.4)  ** Returns the number ``x`` with the sign of ``y`` in the context of ``(x,y)`\
`<span style="color:blue;">`{=html}`-4.0```{=html}\
`>>> math.copysign(-4, 4)`\
`<span style="color:blue;">`{=html}`4.0```{=html}\
`>>> math.fabs(-44)  ** Return the absolute value of the number, as a float **`\
`<span style="color:blue;">`{=html}`44.0```{=html}\
`>>> math.factorial(4)  **  Returns the factorial of a number **`\
`<span style="color:blue;">`{=html}`24```{=html}\
`>>> math.floor(4.3)  ** Rounds the number down to the nearest non decimal number. **`\
`<span style="color:blue;">`{=html}`4```{=html}\
`>>> math.floor(4.99999)`\
`<span style="color:blue;">`{=html}`4```{=html}\
`>>> math.fsum([.1,.2,5,45.2,-.054,.4]) **  Returns the sum of all the numbers in the brackets. Not always precise **`\
`<span style="color:blue;">`{=html}`50.846000000000004```{=html}\
`>>> math.isfinite(3) ** Returns ``True`` if the value is neither an infinity nor a NaN. Returns ``False`` otherwise. **`\
`<span style="color:blue;">`{=html}`True```{=html}


# Non-Programmer's Tutorial for Python 3/The End

So here we are at the end, or maybe the beginning. This tutorial is on
Wikibooks, so feel free to make improvements to it. If you want to learn
more about Python, The Python
Tutorial by Guido van
Rossum has more topics that you can
learn about. If you have been following this tutorial, you should be
able to understand a fair amount of it. The Python
Programming wikibook can be worth
looking at, too.

Hopefully this book covers everything you have needed to get started
programming. Thanks to everyone who has sent me emails about it. I
enjoyed reading them, even when I have not always been the best replier.

Happy programming, may it change your life and the world.

### External Resources

Here are few other books which cover Python 3:

-   A Byte of Python by Swaroop C
    H
-   DataCamp Interactive Python 3 Tutorial -
    Online
-   Hands-on Python Tutorial by Dr. Andrew N.
    Harrington
-   Introduction to Object Oriented Programming in Python by Dr.
    Francesco Lelli
-   Subject:Python programming
    language lists
    other Wikibooks related to Python.


# Blended Learning in K-12/Introduction

|previous=BEGINNING
|next=Definition|What is "Blended Learning"?}}
```
## Introduction

While teachers have always used a variety of teaching methods and media,
blended learning includes the recent availability of digital learning
technologies and Internet-based tools that facilitate communication,
interaction, and collaborative learning. Neither e-learning nor the
traditional classroom are ideal for all types of learning. Blended
learning offers the opportunity to incorporate the \'best of both
worlds\' to improve teaching and learning, to take \"advantage of the
strengths of both learning environments and be more successful in
avoiding their weaknesses.\" (Node, 2003) Evidence from a study
conducted by Alfred P. Rovai and Hope M. Jordan \"suggest that blended
courses produce a stronger sense of community among students than either
traditional or fully online courses\" (Rovai and Jordan, 2004).

The subheadings in this chapter will provide more information about
blended learning, beginning with What is \"Blended
Learning\"?. This
section will discuss what prominent authors in the field are saying
about what blended learning really is. While most authorities in the
field agree on blended learning\'s usefulness, each author has a
slightly different opinion about what makes a class \"blended\". Quotes
will be used from these researchers, explaining their definitions in
detail.

Blended learning has taken many forms since it was first created several
years ago. As blended learning evolved, its name and meaning also
changed. It has been called hybrid learning, mixed mode learning, and
several other names. The second subheading in Chapter One,  The many
names of Blended
Learning,
will discuss the countless names of blended learning, review each
meaning, and look at how it has evolved into the term we know today.

Finally, Chapter One will examine Why is Blended Learning
Important?.
Research from many educational areas will be used to show the merits of
using blended learning instead of just traditional or e-learning
environments.


# Blended Learning in K-12/Definition

|previous=Introduction
|next=The many names of Blended Learning}}
```
Dr. Margaret Driscoll identifies four different concepts in defining
blended learning **The first defines blended learning as meaning \"to
combine or mix modes of Web-based technology (e.g., live virtual
classroom, self-paced instruction, collaborative learning, streaming
video, audio, and text) to accomplish an educational goal.\"**
(Driscoll, 2002) Other authors also define blended learning according to
Driscoll's first. For example in the introduction to \"Building
Effective Blended Learning Programs\", Harry Singh (2003) indicates
blended learning models "combine various delivery modes. Anecdotal
evidence indicates that blended learning not only offers more choices
but also is more effective.\"

Dr. Driscoll's **second definition describes blended learning as meaning
\"to combine various pedagogical approaches (e.g., constructivism,
behaviorism, cognitivism) to produce an optimal learning outcome with or
without instructional technology.\"** (Driscoll, 2002)

As Charles Graham points out in his introduction to the article "Blended
Learning Systems: Definition, Current Trends, and Future Directions",
both of these first two concepts "suffer from the problem that they
define BL so broadly that there encompass virtually all learning
systems." (Bonk & Graham, 2004)

The **third definition from Dr. Driscoll (2002) defines blended learning
as meaning \"to combine any form of instructional technology (e.g.,
videotape, CD-ROM, Web-based training, film) with face-to-face
instructor-led training.\"** (Driscoll, 2002) Most authors echo this
definition such as Gary Harriman, who indicated in his article, "What is
Blended Learning" (2004), that "blended learning combines online with
face-to-face learning. The goal of blended learning is to provide the
most efficient and effective instruction experience by combining
delivery modalities.\" (GrayHarriman, 2004) In addition, Judith Smith in
her article, "Blended Learning: An Old Friend Gets a New Name", defined
blended learning "as a method of educating at a distance that uses
technology (high-tech, such as television and the Internet or low-tech,
such as voice mail or conference calls) combined with traditional (or,
stand-up) education or training.\" (Smith, 2001) Simply put the
Rochester Institute of Technology reported in the "Blended Learning
Pilot Project: Final Report for the Academic Year 2003--2004" that
\"blended learning aims to join the best of classroom teaching and
learning with the best of online teaching and learning.\" (Rochester
Institute, 2004) New South Wales Department of Education and Training
(2005) echoes the above authors in the article, \"Blended Learning" by
stating \"blended learning is learning which combines online and
face-to-face approaches.\" (NSW, 2005) Richard Voos (2003) also repeats
this definition that blended learning is a combination of face-to-face
and online media while he goes on to state that blended learning also
results in \"seat time\" being "significantly reduced". (Voos, 2003)
Carla Garnham and Robert Kaleta (2002) identified blended learning or
hybrid courses as joining the best features of "in-class teaching with
the best features of online learning to promote active independent
learning and reduce class seat time.\" (Garnham and Kaleta, 2002) Alfred
Rovai and Hope Jordan (Aug 2004) in the article \"Blended Learning and
Sense of Community: A Comparative Analysis with Traditional and Fully
Online Graduate Courses\" indicate \"a blended course can lie anywhere
between the continuum anchored at opposite ends by fully face-to-face
and fully online learning environments.\" (Rovai and Jordan, 2004)
"According to Colis and Moonen (2001) blended learning is a hybrid of
traditional face-to-face and online learning so that instruction occurs
both in the classroom and online, and where the online component becomes
a natural extension of traditional classroom learning.\" (Rovai and
Jordan, 2004) e-Learning Centre\'s Library defines blended learning as
\"a learning solution created through a mixture of face-to-face, live
e-learning, self-paced learning as well through a mix of media -- 'the
magic is in the mix!' or 'the beauty is in the blend!' \" (e-Learning
Centre, 2005) The Australian National Training Authority's (2003)
"Definitions of Key Terms Used in e-learning" provides a definition of
blended learning from Flexible Learning Advisory Group (2004) as
"learning methods that combine e-learning with other forms of flexible
learning and more traditional forms of learning. "

**The fourth concept from Dr. Driscoll defines blended learning as
meaning \"to mix or combine instructional technology with actual job
tasks in order to create a harmonious effect of learning and
working.\"** (Driscoll, 2002) This fourth definition gives an indication
as to the popularity of blended learning as part of corporate training.
\"Blended Learning is the latest buzzword in corporate training. Mixing
e-learning with other types of training delivery.\" (Bersin, 2003)

There are other authors who have defined blended learning by combining
Driscoll's first and third concept. The Royer Center for Learning and
Academic Technologies (2004) defines blended learning as intermingling
"multiple learning strategies or methods with a variety of media. In
contemporary terms, learning strategies and media typically include
aspects of face-to-face instruction and online (or distance) learning,
in combination with a rich variety of learning strategies or
dimensions.\" (Royer, 2004) From "The Node\'s Guide to Blended Learning:
Getting the Most out of Your Classroom and the Internet" (2001), the
Node Learning Technologies Network defines blended learning as learning
that uses "multiple strategies, methods and delivery systems" including
the "integration of multiple strategies, methods and delivery systems".

\"Good teachers have always used a mix of strategies, methods and media
to reach their objectives--that's not new. What is new is that today's
Internet-based tools can facilitate communication, interaction, and
collaborative learning in ways that were not possible before. What's
also new is the relative accessibility of digital learning technologies
and the ease with which instructors can blend them with classroom
resources\" (Node, 2003).

Purnima Valiathan (2002) in \"Blended Learning Models" also combined the
Driscoll's first and third concepts of blended learning in stating that
the term blended learning is "used to describe a solution that combines
several different delivery methods, such as collaboration software,
Web-based courses, EPSS, and knowledge management practices ... to
describe learning that mixes various event-based activities, including
face-to-face classrooms, live e-learning, and self-paced learning.\"
(Valiathan, 2002)

In defining "blended learning", a few authors concentrate on the word
blended. As defined in The Concise Oxford Dictionary, 8th edition, to
blend means to "form a harmonious compound, become one". (Concise Oxford
Dictionary 8th edition,1990) As Peter Isackson (2002) emphasizes, the
definition of blended learning needs to focus on the \"blending\" of the
methods and strategies and not just the \"tossing\" together of the
different modalities. Isackson (2002) uses the analogy of good blending
\"like a good Scotch whiskey\"; Royer Center (2004) offers additional
analogies of blending as \"compared to gourmet coffees, wines, hybrid
vehicles, and even gasoline. Each blend offers a variety of choices that
form an appealing whole.\" (Royer, 2004) In connection with these
analogies the Royer Center (2004) goes on to explain that blended
learning can have a variety of flavors and thus "there is no single
approach for 'how to blend' ", just as there exist different recipes for
one type of food dish. "Successful blended learning, like a successful
recipe, mingles a range of complementary ingredients in order to support
the unique purpose of each learning event.\" (Royer, 2004) Thus, as
Isackson (2004) points out, "much of what people claim to offer today as
\"blended learning\" isn\'t so much blended (like a good Scotch whisky)
but \"tossed\" (like a salad)." There is the need to "distinguish
between blended learning \-- where there is a real input/output strategy
and a dynamic structure \-- and \"tossed learning\" where the form of
input alternates.\" (Isackson, 2002) As reported in "The Node\'s Guide
to Blended Learning: Getting the Most out of Your Classroom and the
Internet", \"blended learning can be many things--there is no
prescription and no recipe.\" (Node, 2003)

Finally, as there are a number of concepts for defining blended
learning, Martin Oliver and Keith Trigwell (2005) in their article,
\"Can \'blended learning\' Be Redeemed\", are critical of using the term
at all. Oliver and Trigwell (2005) argue that the term 'blended
learning' is "ill-defined and inconsistently used. Whilst its popularity
is increasing, its clarity is not." Oliver and Trigwell (2005) state
that definitions of blended learning lack "an analysis from the
perspective of the learner.\" Oliver and Trigwell (2005) suggest the
need for a \"shift away from manipulating the blend as seen by the
teacher, to an in-depth analysis of the variation in the experience of
the learning of the student in the blended learning context.Along the
same line as Oliver and Trigwell\'s (2005) criticism of the use of the
term \"blended learning\", Don Morrison (2003) writes, \"Personally, I'm
much more comfortable talking about the strategic use of learning
delivery channels than 'blended learning'. Every enterprise has learning
delivery channels---it\'s a question of identifying them and deciding
which to use when.\" He continues by saying, \"I have heard blended
learning dismissed as the Emperor\'s New Clothes on the basis that all
learning---from infancy, through the classroom, and into the
enterprise---is blended learning.\" (Morrison, 2003)


# Blended Learning in K-12/The many names of Blended Learning

|previous=Definition
|next=Why is Blended Learning Important?}}
```
Blended Learning has been around for many years, but the name has
changed as the uses and recognition have increased. Many people may be
using a form of blended learning in lessons and teaching, but may not
realize it or be able to give it an actual name. Blended learning is
something that is used in the world of education as well as the world of
business. Blended learning is not a new concept, but may be a new term
to many users. Below is a list and explanation of just a few of the more
common, but older, names of blended learning.

\"You may hear blended learning described as "integrated learning",
"hybrid learning", "multi-method learning" (Node, 2001). \"The term
\"blended learning\" is being used with increasing frequency in both
academic and corporate circles. In 2003, the American Society for
Training and Development identified blended learning as one of the top
ten trends to emerge in the knowledge delivery industry\" (cited in
Rooney, 2003) (Graham, 2004).

## **Blended Learning - Descriptions**

Blended Learning: Learning methods that combine e-learning with other
forms of flexible learning and more traditional forms of learning.
(Flexible Learning Advisory Group 2004)

Blended learning (also called hybrid learning) is the term used to
describe learning or training events or activities where e-learning, in
its various forms, is combined with more traditional forms of training
such as \"class room\" training(Stockley, 2005).

Blended learning is usually defined as the combination of multiple
approaches to teaching. It can also be defined as an educational
processes, which involves the deployment of a diversity of methods and
resources or to learning experiences, which are derived from more than
one kind of information source. Examples include combining
technology-based materials and traditional print materials, group and
individual study, structured pace study and self-paced study, or
tutorial and coaching (Blended Learning, 2005).

Blended learning can be delivered in a variety of ways. A common model
is delivery of \"theory\" content by e-learning prior to actual
attendance at a training course or program to put the \"theory\" into
practice. This can be a very efficient and effective method of delivery,
particularly if travel and accommodation costs are involved. This
mixture of methods reflects the hybrid nature of the training.
(Stockley, 2005)

These explanations show how blended learning is viewed in different
situations, different environments, and by different people. As is
suggested blended learning involves the use of some technology as well
as the use of more traditional methods to allow the student to work and
learn at his/her own pace. Blended learning is a relatively new term.
However, the ideas of this style of teaching and learning behind it are
more common. The following is a list of synonyms or previous terms that
are linked to blended learning.

## **Hybrid Learning - Descriptions**

\"Hybrid instruction is the single greatest unrecognized trend in higher
education today\"---Graham Spanier, President of Penn State University
(TLC, 2002).

Hybrid courses (also known as blended or mixed mode courses) are courses
in which a significant portion of the learning activities have been
moved online (generally 30 - 75%), and time traditionally spent in the
classroom is reduced but not eliminated. The goal of hybrid courses is
to pair the best features of face-to-face teaching with the best options
of online learning to promote active and independent learning and reduce
class seat time. Using instructional technologies, the hybrid model
forces the redesign of some lecture or lab content into new online
learning activities, such as case studies, tutorials, self-testing
exercises, simulations, and online group collaborations (NJIT, 2005).

Using computer-based technologies, instructors use the hybrid model to
redesign some lecture or lab content into new online learning
activities, such as case studies, tutorials, self-testing exercises,
simulations, and online group collaborations (TLC, 2002).

Hybrid courses seem to be the pre-step to blended learning. Hybrid
courses involve a great amount of technology. They also greatly increase
the independence of the student by allowing him/her to work at his/her
own pace outside of the typical classroom. this is obviously a synonym
of blended learning as the explanations and ideas seem to differ very
little from those of blended learning.

## **Integrated Learning - Descriptions**

Teaching strategies that enhance brain-based learning include
manipulative, active learning, field trips, guest speakers, and
real-life projects that allow students to use many learning styles and
multiple intelligences. An interdisciplinary curriculum or integrated
learning also reinforces brain-based learning, because the brain can
better make connections when material is presented in an integrated way,
rather than as isolated bits of information (ASCD, 2005).

ILS (integrated learning system): A complete software, hardware, and
network system used for instruction. In addition to providing curriculum
and lessons organized by level, an ILS usually includes a number of
tools such as assessments, record keeping, report writing, and user
information files that help to identify learning needs, monitor
progress, and maintain student records (ASTD, 2005).

As stated by Node in the introduction, integrated learning is also seen
as a stepping stone to blended learning. This term shows a need for more
methods of teaching than the traditional classroom can offer. This is of
course the basis for blended learning. Integrated learning allows a
teacher to provided instruction to students in a way that will be
meaningful and interesting to each learner. This again is the main
concept behind blended learning.

## **Multi-method Learning or Mixed Mode Learning**

As a capability, learning is often thought of as one of the necessary
conditions for intelligence in an agent. Some systems extend this
requirement by including a plethora of mechanisms for learning in order
to obtain as much as possible from the system, or to allow various
components of their system to learn in their own ways (depending on the
modularity, representation, etc., of each). On the other hand, multiple
methods are included in a system in order to gauge the performance of
one method against that of another (Cognitive Architectures, 1994).

Node also mentions multi method learning and its connection to blended
learning. Again it is not a synonym of blended learning, but instead a
stepping stone. This shows a user how teaching outside the traditional
box can and is more meaningful to learners.

## **e-learning**

\"e-learning is a broader concept \[than online learning\], encompassing
a wide set of applications and processes which use all available
electronic media to deliver vocational education and training more
flexibly. The term "e-learning" is now used in the Framework to capture
the general intent to support a broad range of electronic media
(Internet, intranets, extranets, satellite broadcast, audio/video tape,
interactive TV and CD-ROM) to make vocational learning more flexible for
clients\" (ANTA 2003b, p. 5).

\"E-learning (elearning, eLearning) is the newer, more encompassing term
for those activities previously described by the term \"computer based
training\". Computer based training has existed for many years now\"
(Stockley, 2005).

e-learning is not a synonym of blended learning, but is a major
component of a successful blended learning unit. Without e-learning,
there would be no real technology. Without technology, there would be
little hope of blended learning. Therefore the concept of e-learning is
a major aspect of blended learning and one that needs to be recognized
and understood by those interested in blended learning.

## **Flexible Learning**

The provision of a range of learning modes or methods, giving learners
greater choice of when, where and how they learn. See also Flexible
delivery.

www.trainandemploy.qld.gov.au/tools/glossary/glossary_f.htm

Describes an educational regime providing pathway choices and learner
control of the learning process.

www.lmuaut.demon.co.uk/trc/edissues/ptgloss.htm (Google Web, 2005)

\"The term flexible learning is referred broadly to mean increased
learner choice in content, sequence, method, time, and place of
learning. In addition it is also associated with increased flexibility
in administrative and course management processes. However it is
interesting to note that most literature refers to online learning as
only a form of flexible learning, but there is a clear emphasis on the
use of online technologies to achieve flexible learning goals\" (VU
TAFE, 2004).

Flexible learning aims to meet individual needs by providing choices
that allow students to meet their own educational requirements in ways
suiting their individual circumstances. Choices may be offered in:

time and/or place of study - opportunities to study on- and off-campus
or combinations of both;

learning styles and preferences - the availability of a range of
learning resources and tasks to suit individual needs;

contextualized learning - the ability to tailor some or all of the
learning content, process, outcomes or assessment to individual
circumstances;

access - flexible entry requirements, multiple annual starting points,
recognition of prior learning, articulation between programs of study
and cross-crediting arrangements;

pace - unit completion on the basis of achievement of specified
competencies rather than according to a pre-determined calendar;

progression - flexible progression requirements and teaching periods
allowing accelerated or delayed completion of study; and

learning pathways - degree requirements allowing choice in programs of
study.

The student-centered approach underpinning flexible learning requires
different teaching methodologies and also different relationship between
teachers and students. In comparison to traditional educational models,
flexible learning is broadly characterized by:

\- less reliance on face-to-face teaching and more emphasis on guided
independent learning; teachers become facilitators of the learning
process directing students to appropriate resources, tasks and learning
outcomes.

\- greater reliance on high quality learning resources using a range of
technologies (e.g., print, CD-ROM, video, audio, the Internet)

\- greater opportunities to communicate outside traditional teaching
times

\- an increasing use of information technology (IT). Flexible learning
is not synonymous with the use of IT but IT is often central to much of
the implementation of flexible learning, for example in delivering
learning resources, providing a communications facility, administering
units and student assessment, and hosting student support systems.

\- the deployment of multi-skilled teams. Rather than the academics
responsible undertaking all stages of unit planning, development,
delivery, assessment and maintenance, other professionals are often
required to provide specific skills, for example in instructional
design, desktop publishing, web development and administration and
maintenance of programs (Centre for Felxible Learning, 2005).

Flexible learning is the main concept and reasoning behind blended
learning. The point of creating blended learning was to allow flexible
learning for the students. This term then is also a major aspect of
blended learning. It needs to be recognized and understood by users in
order to better create and deliver a blended learning unit to students.

As can be seen from the above examples and explanations, technology may
not be a given to blended learning, but an addition. Instead we need to
look at blended learning as using methods outside the traditional
classroom and teaching to help interest and reach all learners. These
methods could be using technology, or just some other form of teaching,
like speakers or manipulative, to help all student learning, to reach
all the students in the class.


# Blended Learning in K-12/Why is Blended Learning Important?

|previous=The many names of Blended Learning
|next=Evolution of Blended Learning}}
```
Now that you know what blended learning is, you may be asking yourself,
\"Why do I need to know about blended learning? Why is it important?\"
Over the years, many groups of people have asked this same question.
These groups have included classroom teachers and others in the field of
education, but have also included people in the business field as well.
Blended learning makes up the "fastest growing use of technologies in
learning---much faster then the development of online courses."
(Alvarez, 2005) Because of the interest in blended learning, there have
been many research studies done to find the potential strengths and
weaknesses of blended learning as compared to just the traditional
classroom or e-learning.

## In Education

Educators seem to have the most interest in blended learning, for
obvious reasons. Because of this, much of the research on blended
learning has been based around classroom situations. All levels of
education have been researched with blended learning, from the
elementary school grades up to graduate school. Educators' interests in
blended learning is best summarized by Flavin in his E-Learning
Advantages in a Tough Economy. He states:

Ironically, the notion of blending is nothing new. Good classroom
teachers have always blended their methods---reading, writing, lecture,
discussion, practice and projects, to name just a few, are all part of
an effective blend. Blending is only a revelation for those who have
been trying to do everything with just one tool---usually the
computer---and ending up with less than ideal results. Understanding
that using the right tool, in the right situation, for the right purpose
should be a guiding design principle. (Flavin, 2001)

One clear advantage of blended learning in education is its connection
with differentiated instruction. Differentiated instruction involves
"custom-designing instruction based on student needs." (deGula, 2004) In
differentiated instruction, educators look at students' learning styles,
interests, and abilities. Once these factors have been determined,
educators decide which curriculum content, learning activities,
products, and learning environments will best serve those individual
students' needs. Blended learning can fit into a number of these areas.
By using blended learning, educators are definitely altering the
learning environment when students work collaboratively in learning
communities online, for example. Teachers could also add relevant
curriculum content that would be unavailable or difficult to comprehend
outside of the internet. Learning activities and products can also be
changed to use technologies in a classroom that uses blended learning.

So what does the research say? In a study by Dean and associates,
research showed that providing several online options in addition to
traditional classroom training actually increased what students learned.
(2001) Another study showed that student interaction and satisfaction
improved, along with students learning more, in courses that
incorporated blended learning. (DeLacey and Leonard, 2002)

Another advantage of blended learning is pacing and attendance. In most
blended learning classrooms, there is the ability to study whenever the
student chooses to do so. If a student is absent, she/he may view some
of the missed materials at the same time that the rest of the class
does, even though the student cannot be physically in the classroom.
This helps students stay on track and not fall behind, which is
especially helpful for students with prolonged sicknesses or injuries
that prevent them from attending school. These "self-study modules" also
allow learners to review certain content at any time for help in
understanding a concept or to work ahead for those students who learn at
a faster pace. (Alvarez, 2005)

Because of the ability of students to self-pace, there is a higher
completion rate for students in blended learning classrooms than to
those in strictly e-learning situations. (Flavin, 2001) This self-pacing
allows for the engagement of every learner in the classroom at any given
time. Students also see that the learning involved becomes a process,
not individual learning events. This revelation allows for an increased
application of the learning done in the classroom. (Flavin, 2001)

With the given research, it is clear that using blended learning in
education improves the teaching and learning done in a given course.
Educators want to teach in a way that best reaches all of their
students. If blended learning accomplishes this, then more teachers will
begin to use these methods. When teachers begin to explore blended
learning and the resources that can be found through the internet and
other technologies, they can structure their classroom in a way that
best suits their teaching style and their students' learning styles.
Blended learning allows "\[teachers\] and \[their\] students to have the
best of both worlds." (Alvarez, 2005) The traditional classroom and
e-learning both have advantages and disadvantages. As Alvarez states,
"the online environment is not the ideal setting for all types of
learning. Classrooms are not perfect either.... That's why so many
teachers and corporate trainers are concentrating their efforts on
integrating internet-based technologies and classrooms to create blended
learning environments. It just makes good sense." (2005)

As stated above blended learning should provide students and teachers
with the best of both worlds. I Agree that this should happen, but I am
not convinced that this does happen. Teachers that have been teaching
for numerous years may be stuck in their traditional teaching methods.
These same teachers may not be technology literate which in turn limits
what they can do with technology. Teachers must be trained and required
to use some type of technology in the classroom if blended learning is
going to successfully take place. The teachers may use a variety of
teaching styles, but without technology the students are being cheated
out of what they need to be successful in today\'s world. Proper teacher
training is the only way teachers and students will \"get the best of
both worlds.\" Bret M. Helms

## In Business

Blended learning is also of interest to corporate world. Through
different studies, blended learning has been shown to be an effective
tool in worker training and education. One of the best advantages of
blended learning for the business world is its cost-effectiveness. When
a business relies purely on instructor-led training, besides paying the
cost of the trainer, there are also transportation, hotel, food, and
other expenses. Blended learning helps reduce these expenditures by
reducing the amount of time needed to face-to-face instruction.
(Alvarez, 2005) "Effective blending lets an organization spend the
dollars in the most beneficial, cost effective way." (Flavin, 2001) A
business can decide what mix of face-to-face and e-learning would best
fit their learning objectives.

One study which illustrates some of the benefits of blended learning in
today's business world is the Thomson Job Impact Study. (2003) This
study had 128 participants from a number of corporate and academic
organizations, including Lockheed-Martin, Utah State University,
National Cash Register, and the University of Limerick in Limerick,
Ireland. The researchers wanted to determine if blended learning
increased the overall learning in a number of areas. What they found
supports the use of blended learning in the corporate world. The blended
learning group "significantly" out-performed the traditional and
e-learning group in spreadsheet application performance and they took
less time to complete the real-world tasks than did the e-learning
group. Overall, the blended learning classroom achieved a performance
improvement of 30 percent. (Thomson, 2003). Given these apparent
benefits, it is only natural that the business world is now also
incorporating blended learning techniques into their employee training
and education programs. By doing a quick internet search, a business
could find a number of manuals and examples of how to incorporate
blended learning strategies into their own programs. There are also
companies which specialize in bringing blended learning programs into
the business world.

As one can see, the benefits of using blended learning have been
carefully researched. Most people would agree that these benefits
support the use of blended learning in the classroom and in the business
realm as well. It is up to the individual educator or business how best
to use the tools of blended learning to meet their own goals and those
of their students/workers. really


# Blended Learning in K-12/Types of Blended Learning

|previous=Evolution of Blended Learning
|next=Types of Blended Learning/multimedia virtual internet}}
```
As stated previously, K-12 may be the last to utilize Blended Learning
but it has certainly gone beyond the \'trickle down effect.\' There is a
growing trend to use technology in K-12 classrooms and more grants and
financial opportunities are making Blended learning a reality. Because
there are multiple tools available for use when incorporating *Blended
Learning* in the K-12 classroom by a teacher, it is important to
highlight what is available to create a blended learning environment.
According to \"Building Effective Blended Learning Programs\" by Harvey
Singh, \"Blended Learning Programs may include several forms of learning
tools, such as real-time virtual/collaboration software, self-paced
Web-based courses, electronic performance support systems (EPSS)
embedded within the job-task environment, and knowledge management
systems. Blended learning mixes various event based activities,
including face-to-face classrooms, live e-learning, and self-paced
learning\" (Singh, 2003).

\"From a course design perspective, a blended course can lie anywhere
between the continuum anchored at opposite ends by fully face-to-face
and fully online learning environments.\" (Rovai and Jordan, 2004) This
chapter presents explanations of the various types of tools available to
create a blended learning environment in the classroom. The following
categories will be used to organize major types:

1.  The use of Multimedia and Virtual Internet
    Resources
    in the classroom. Examples include the use of videos, virtual field
    trips, and interactive websites.
2.  The use of Classroom
    Websites
    in the classroom. Included is a growing list of examples of useful
    blended learning websites.
3.  The use of Course Management
    Systems.
    Examples include the use of Moodle, WebCT and Blackboard.
4.  The use of Synchronous and Asychronous
    Discussions
    in the classroom. Examples of resources available include Yahoo
    Groups, TappedIn, Blogs, and Elluminate.


# Blended Learning in K-12/Characteristics of Blended Learning

|previous=Types of Blended Learning/Synchronous Asychronous Discussions
|next=General Comparisons in Blended Learning }}
```
What are the main characteristics of Blended Learning? What makes
blended learning unique, different, special?

The term "Blended Learning", while popular, has been subjected to
criticism, mostly because the definition lacks specificity. (See section
1.1 \"What is Blended Learning?\")The term applies to diverse
situations, including professional development in the business world,
and technology integration in the K-12 and university settings, and
describes a range of instructional practices. Indeed, one critical
article has suggested that it is the very focus on instructional
practices that is problematical, and that blended learning should
instead focus on content from the learner's, rather than the
instructor's, perspective. (Oliver and Trigwell, 2005) Although
criticizing the terminology appears to be merely a discussion over
semantics, the lack of specificity raises an interesting question: What
are the characteristics of blended learning? A number of sources
summarize the following characteristics as being unique to the blended
learning environment.

-   General Comparisons in Blended
    Learning

```{=html}
<!-- -->
```
-   Pedagogical Models- blending constructivism, behaviorism and
    cognitivism

```{=html}
<!-- -->
```
-   Synchronous and asynchronous communication
    methods

`   Taking each of these point for point, we may attempt to characterize blended learning by examining its appearance point for point. In other words, by describing these blends as they should appear in a “real” context, we can begin to understand blended learning not as a textbook definition, but as a concept for learning and instruction in the Twenty-first Century.`