Skip to content
Snippets Groups Projects
Commit 2eefbd39 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'master' into 'master'

Functions are introduced in first practical

See merge request fsl/pytreat-2018-practicals!23
parents f56044ca 04517690
No related branches found
No related tags found
No related merge requests found
...@@ -346,9 +346,12 @@ def whatisit(path, existonly=False): ...@@ -346,9 +346,12 @@ def whatisit(path, existonly=False):
``` ```
> This is the first time in this series of practicals that we have defined our > This is the first time in a while that we have defined our own function,
> own function, [hooray!](https://www.youtube.com/watch?v=zQiibNVIvK4) All > [hooray!](https://www.youtube.com/watch?v=zQiibNVIvK4). Here's a quick
> function definitions in Python begin with the `def` keyword: > refresher on how to write functions in Python, in case you have forgotten.
>
> First of all, all function definitions in Python begin with the `def`
> keyword:
> >
> ``` > ```
> def myfunction(): > def myfunction():
...@@ -424,10 +427,10 @@ print('Directory and base names: {}'.format(op.split( path))) ...@@ -424,10 +427,10 @@ print('Directory and base names: {}'.format(op.split( path)))
``` ```
> Note here that `op.split` returns both the directory and base names - it is > Note here that `op.split` returns both the directory and base names - remember
> super easy to define a Python function that returns multiple values, simply by > that it is super easy to define a Python function that returns multiple values,
> having it return a tuple. For example, the implementation of `op.split` might > simply by having it return a tuple. For example, the implementation of
> look something like this: > `op.split` might look something like this:
> >
> >
> ``` > ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment