From 87b7b6d675b934fac6237e37e8d8619adc980638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Kaczmarek?= Date: Tue, 28 Nov 2017 18:27:00 +0100 Subject: [PATCH] Resolved --- .idea/vcs.xml | 6 ++++++ labs02/task02.py | 11 ++--------- labs02/task03.py | 12 ++++++++++-- 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/labs02/task02.py b/labs02/task02.py index c447e02..637c331 100644 --- a/labs02/task02.py +++ b/labs02/task02.py @@ -5,15 +5,8 @@ Napisz funkcję days_in_year zwracającą liczbę dni w roku (365 albo 366). """ - -""" -jest podzielna przez 4 i niepodzielna przez 100, lub -jest podzielna przez 400. -""" -def days_in_year(days): - if (days%4 == 0 & days%100 != 0): - return 366 - elif days%400: +def days_in_year(year): + if (year%4 == 0 and year%100 != 0) or year%400==0: return 366 else: return 365 diff --git a/labs02/task03.py b/labs02/task03.py index a1c3a85..de9652b 100644 --- a/labs02/task03.py +++ b/labs02/task03.py @@ -13,8 +13,14 @@ jak 'set', która przechowuje elementy bez powtórzeń.) def oov(text, vocab): - pass - + text_words=text.split() + oov_list=[] + for word in text_words: + if word in vocab: + pass + else: + oov_list.append(word) + return oov_list def tests(f): @@ -30,3 +36,5 @@ def tests(f): if __name__ == "__main__": print(tests(oov)) + +