{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"gap_exercise2_functions.ipynb","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyPNmMiCfZgG80utvjFwmIDH"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"markdown","source":["# Python course - Exercises Gap text"],"metadata":{"id":"kH0p2uT-sQ6y"}},{"cell_type":"markdown","source":["Correct the Code"],"metadata":{"id":"uW9SoYEyrlRL"}},{"cell_type":"code","source":["# How are functions defined?\n"," my_function(b):\n"," print(b+10)\n","\n","a=5\n","my_function(a)"],"metadata":{"id":"uoscfCSCK980"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# What is missing?\n"," concat_sequences( seq1, seq2, seq3 ):\n"," print(seq1 + seq2 + seq3)\n","\n","concat_sequences('ACGTC', 'GTCAA')"],"metadata":{"id":"VI2uTjtJMZ-L"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# correct the code such that the function delivers b+10\n"," my_function(b):\n"," (b+10)\n","\n","result = my_function(5)\n","print( result)"],"metadata":{"id":"GN89HlxMJRAQ"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# undefined number of arguments: what is needed?\n"," concat_sequences( seq ):\n"," print(seq[0] + seq[1] + seq[2])\n","\n","concat_sequences('ACGTC', 'GTCAA', 'TAGCTGC')"],"metadata":{"id":"UOsFUQSHKGXH"},"execution_count":null,"outputs":[]}]}
\ No newline at end of file
%% 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?
my_function(b):
print(b+10)
a=5
my_function(a)
```
%% Cell type:code id: tags:
```
# What is missing?
concat_sequences( seq1, seq2, seq3 ):
print(seq1 + seq2 + seq3)
concat_sequences('ACGTC', 'GTCAA')
```
%% Cell type:code id: tags:
```
# correct the code such that the function delivers b+10