forked from tdwojak/Python2017
Resolved
This commit is contained in:
parent
76f3b5ba55
commit
87b7b6d675
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -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
|
||||
|
@ -13,8 +13,14 @@ jak 'set', która przechowuje elementy bez powtórzeń.)
|
||||
|
||||
|
||||
def oov(text, vocab):
|
||||
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))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user