Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
win-pytreat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
win-pytreat
Commits
04517690
Commit
04517690
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Functions are introduced in first practical - turned introduction in file
management prac into a "refresher"
parent
f56044ca
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
getting_started/03_file_management.md
+10
-7
10 additions, 7 deletions
getting_started/03_file_management.md
with
10 additions
and
7 deletions
getting_started/03_file_management.md
+
10
−
7
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:
>
>
> ```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment