Skip to content

Commit 7f41121

Browse files
authored
Merge pull request #3635 from galaxyproject/asdf
Add a simple poll to quizzes
2 parents 85fd90b + 04a8968 commit 7f41121

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Diff for: quiz/poll.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
title: Simple poll
2+
contributors:
3+
- hexylena
4+
5+
questions:
6+
- title: What do you think?
7+
answers:
8+
- Amazing! I love it
9+
- Neat!
10+
- Meh
11+
- Please remove this
12+
correct:
13+
- count(name)
14+
- count(*)
15+
timeout: 30
16+
type: poll
17+
live: true

Diff for: topics/data-science/tutorials/python-functions/tutorial.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ time_estimation: 30M
2525
key_points:
2626
- Functions are foundational in Python
2727
- Everything you do will require functions
28+
- Functions keep your code DRY (don't repeat yourself), reducing your copying and pasting or rewriting the same block of code.
29+
- Deciding what part of your code should, or should not be, a function is something that will come with practice.
2830

2931
subtopic: python-modular
3032
contributors:
@@ -176,7 +178,7 @@ def fahr_to_kelvin(temp_f):
176178
print(f'boiling point of water in Kelvin: {fahr_to_kelvin(212.0)}')
177179
```
178180

179-
For a function this small, with such a descriptive name (`fahr_to_kelvin`) it feels quite obvious what the function should do, what inputs it takes, what outputs it produces. However
181+
For a function this small, with such a descriptive name (`fahr_to_kelvin`) it feels quite obvious what the function should do, what inputs it takes, what outputs it produces. However, you will thank yourself in the future if you do this now. You may think you will remember what the code does, but, be kind to your future self who is busy and stressed and may not want to spend time reading the code over again to figure out what every single function does.
180182

181183
> ### {% icon question %} Question: Converting statements to functions
182184
> A lot of what you'll do in programing is to turn a procedure that you want to do, into statements and a function.
@@ -189,6 +191,7 @@ For a function this small, with such a descriptive name (`fahr_to_kelvin`) it fe
189191
> > c = (a + b) / 2
190192
> > return c
191193
> > ```
194+
> > We call it "average2" here because it will only average two numbers. It will not work for three numbers or a list of them.
192195
> {: .solution}
193196
{: .question}
194197

0 commit comments

Comments
 (0)