-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
612 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!coverage.py: This is a private format, don't read it directly!{"arcs":{"/home/vpayno/git_vpayno/exercism-workspace/python/raindrops/test/__init__.py":[[0,0],[0,-1]],"/home/vpayno/git_vpayno/exercism-workspace/python/raindrops/raindrops.py":[[0,1],[1,4],[4,-1],[4,11],[11,13],[13,16],[16,19],[19,22],[22,23],[23,25],[25,-4],[13,14],[14,16],[16,17],[17,19],[19,20],[20,22],[22,25]]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" ?> | ||
<coverage branch-rate="1" branches-covered="8" branches-valid="8" complexity="0" line-rate="0.9167" lines-covered="11" lines-valid="12" timestamp="1712624760382" version="4.5.4"> | ||
<!-- Generated by coverage.py: https://coverage.readthedocs.io --> | ||
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd --> | ||
<sources> | ||
<source>/home/vpayno/git_vpayno/exercism-workspace/python/raindrops</source> | ||
</sources> | ||
<packages> | ||
<package branch-rate="1" complexity="0" line-rate="0.9167" name="."> | ||
<classes> | ||
<class branch-rate="1" complexity="0" filename="raindrops.py" line-rate="0.9167" name="raindrops.py"> | ||
<methods/> | ||
<lines> | ||
<line hits="0" number="0"/> | ||
<line hits="1" number="4"/> | ||
<line hits="1" number="11"/> | ||
<line branch="true" condition-coverage="100% (2/2)" hits="1" number="13"/> | ||
<line hits="1" number="14"/> | ||
<line branch="true" condition-coverage="100% (2/2)" hits="1" number="16"/> | ||
<line hits="1" number="17"/> | ||
<line branch="true" condition-coverage="100% (2/2)" hits="1" number="19"/> | ||
<line hits="1" number="20"/> | ||
<line branch="true" condition-coverage="100% (2/2)" hits="1" number="22"/> | ||
<line hits="1" number="23"/> | ||
<line hits="1" number="25"/> | ||
</lines> | ||
</class> | ||
</classes> | ||
</package> | ||
<package branch-rate="1" complexity="0" line-rate="1" name="test"> | ||
<classes> | ||
<class branch-rate="1" complexity="0" filename="test/__init__.py" line-rate="1" name="__init__.py"> | ||
<methods/> | ||
<lines/> | ||
</class> | ||
</classes> | ||
</package> | ||
</packages> | ||
</coverage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
omit = __init__.py, *_test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../.pylintrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[pytest] | ||
pythonpath = . | ||
addopts = --doctest-modules | ||
markers = | ||
task: exercise task/step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
def convert(number): | ||
pass | ||
"""Raindrops exercism: https://exercism.org/tracks/python/exercises/raindrops""" | ||
|
||
|
||
def convert(number: int) -> str: | ||
"""Converts a number to the sound of rain drops. | ||
:param number: positive integer | ||
:return: string with rain sounds or the number if it can't be converted | ||
""" | ||
|
||
sounds: list[str] = [] | ||
|
||
if number % 3 == 0: | ||
sounds.append("Pling") | ||
|
||
if number % 5 == 0: | ||
sounds.append("Plang") | ||
|
||
if number % 7 == 0: | ||
sounds.append("Plong") | ||
|
||
if len(sounds) == 0: | ||
sounds.append(f"{number}") | ||
|
||
return "".join(sounds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
> """Raindrops exercism: https://exercism.org/tracks/python/exercises/raindrops""" | ||
|
||
|
||
> def convert(number: int) -> str: | ||
> """Converts a number to the sound of rain drops. | ||
|
||
> :param number: positive integer | ||
> :return: string with rain sounds or the number if it can't be converted | ||
> """ | ||
|
||
> sounds: list[str] = [] | ||
|
||
> if number % 3 == 0: | ||
> sounds.append("Pling") | ||
|
||
> if number % 5 == 0: | ||
> sounds.append("Plang") | ||
|
||
> if number % 7 == 0: | ||
> sounds.append("Plong") | ||
|
||
> if len(sounds) == 0: | ||
> sounds.append(f"{number}") | ||
|
||
> return "".join(sounds) |
Oops, something went wrong.