Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mark Chiew
pytreat-practicals-2020
Commits
04517690
Commit
04517690
authored
Feb 16, 2018
by
Paul McCarthy
🚵
Browse files
Functions are introduced in first practical - turned introduction in file
management prac into a "refresher"
parent
f56044ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
getting_started/03_file_management.md
View file @
04517690
...
...
@@ -346,9 +346,12 @@ def whatisit(path, existonly=False):
```
> This is the first time in this series of practicals that we have defined our
> own function, [hooray!](https://www.youtube.com/watch?v=zQiibNVIvK4) All
> function definitions in Python begin with the `def` keyword:
> This is the first time in a while that we have defined our own function,
> [hooray!](https://www.youtube.com/watch?v=zQiibNVIvK4). Here's a quick
> 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():
...
...
@@ -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
> super easy to define a Python function that returns multiple values,
simply by
> having it return a tuple. For example, the implementation of
`op.split` might
> look something like this:
> Note here that `op.split` returns both the directory and base names -
remember
>
that it is
super easy to define a Python function that returns multiple values,
>
simply by
having it return a tuple. For example, the implementation of
>
`op.split` might
look something like this:
>
>
> ```
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment