Skip to content
Snippets Groups Projects
Commit 69751311 authored by Franziska Niemeyer's avatar Franziska Niemeyer
Browse files

Upload solutions for gap_exercise2_functions

parent ab07bccb
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# Python course - Exercises Gap text
%% Cell type:markdown id: tags:
Correct the Code
%% Cell type:code id: tags:
```
# How are functions defined?
def my_function(b):
print(b+10)
a=5
my_function(a)
```
%% Output
15
%% Cell type:code id: tags:
```
# What is missing?
def concat_sequences( seq1, seq2, seq3 ):
print(seq1 + seq2 + seq3)
concat_sequences('ACGTC', 'GTCAA', 'TTACC')
```
%% Output
ACGTCGTCAATTACC
%% Cell type:code id: tags:
```
# correct the code such that the function delivers b+10
def my_function(b):
return (b+10)
result = my_function(5)
print(result)
```
%% Output
15
%% Cell type:code id: tags:
```
# undefined number of arguments: what is needed?
def concat_sequences( seq ):
print(seq[0] + seq[1] + seq[2])
concat_sequences(['ACGTC', 'GTCAA', 'TAGCTGC'])
```
%% Output
ACGTCGTCAATAGCTGC
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