diff --git a/labs01/wprowadzenie.ipynb b/labs01/wprowadzenie.ipynb index 7f56f76..0371781 100644 --- a/labs01/wprowadzenie.ipynb +++ b/labs01/wprowadzenie.ipynb @@ -112,6 +112,13 @@ " \n", " Motywacje zaczerpnięte m.in. z [5 Reasons why Python is Powerful Enough for Google](https://www.codefellows.org/blog/5-reasons-why-python-is-powerful-enough-for-google)." ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/labs02/task03.py b/labs02/task03.py index 2d7ac49..a1c3a85 100644 --- a/labs02/task03.py +++ b/labs02/task03.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + """ Zad 4. Napisz funkcje oov(text, vocab), która zwraca listę wyrazów @@ -15,8 +18,8 @@ def oov(text, vocab): def tests(f): - inputs = [("This is a string , which I will use for string testing", - [',', 'this', 'is', 'a', 'which', 'for', 'will', 'I'])] + inputs = [("this is a string , which i will use for string testing", + [',', 'this', 'is', 'a', 'which', 'for', 'will', 'i'])] outputs = [['string', 'testing', 'use']] for input, output in zip(inputs, outputs): diff --git a/labs02/task04.py b/labs02/task04.py index 948b36f..37413f1 100644 --- a/labs02/task04.py +++ b/labs02/task04.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- """ Napisz funkcję sum_from_one_to_n zwracającą sume liczb od 1 do n. diff --git a/labs02/task05.py b/labs02/task05.py index 4517c4f..f59268a 100644 --- a/labs02/task05.py +++ b/labs02/task05.py @@ -6,6 +6,7 @@ Napisz funkcję euclidean_distance obliczającą odległość między dwoma punktami przestrzeni trójwymiarowej. Punkty są dane jako trzyelementowe listy liczb zmiennoprzecinkowych. +np. odległość pomiędzy punktami (0, 0, 0) i (3, 4, 0) jest równa 5. """ def euclidean_distance(x, y): diff --git a/labs02/task11.py b/labs02/task11.py index f12011d..7d36767 100644 --- a/labs02/task11.py +++ b/labs02/task11.py @@ -4,7 +4,8 @@ """ Napisz funkcję common_chars(string1, string2), która zwraca alfabetycznie -uporządkowaną listę wspólnych znaków z lańcuchów string1 i string2. +uporządkowaną listę wspólnych liter z lańcuchów string1 i string2. +Oba napisy będą składać się wyłacznie z małych liter. """ def common_chars(string1, string2): @@ -12,8 +13,8 @@ def common_chars(string1, string2): def tests(f): - inputs = [["this is a string", "Ala ma kota"]] - outputs = [[' ', 'a', 't']] + inputs = [["this is a string", "ala ma kota"]] + outputs = [['a', 't']] for input, output in zip(inputs, outputs): if f(*input) != output: diff --git a/labs02/test_task.py b/labs02/test_task.py index 3b13715..26661d3 100755 --- a/labs02/test_task.py +++ b/labs02/test_task.py @@ -6,7 +6,7 @@ def suma(a, b): """ Napisz funkcję, która zwraca sumę elementów. """ - pass + return a + b def tests(f): inputs = [(2, 3), (0, 0), (1, 1)]