Operations on lists are through something called "methods", which are essentially functions, but with a slight twist.

Where you would call a function on a string like this:

function(s)

you call a method on a list like this:

s.method()

so the only difference is really that you use the "dot notation" that you have seen for modules.

The clever thing about methods, as opposed to functions, is that you are explicit about which object (the list) you are manipulating, since it is part of the syntax for calling the method. Methods are an important part of something called Object Oriented Programming, a technique that has revolutionized programming back in the eighties and is pretty much dominant in programming these days. Unfortunately we do not have time in this course to cover Object Oriented Programming, so that is all I will say about it, except that you must use this different notation for manipulating strings.

Index

Contact info

Office address:
Bioinformatics Research Centre (BiRC)
Aarhus University
C.F. Møllers Allé 8
DK-8000 Aarhus C
Denmark
Office phone:
+45 871 55558
Mobile phone:
3013 8342
Email:
kaspermunch@birc.au.dk