Skip to content

Commit

Permalink
Final QA
Browse files Browse the repository at this point in the history
  • Loading branch information
gahjelle committed Nov 28, 2024
1 parent c328778 commit 1f2d2dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions name-main-idiom/echo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
def echo(text: str, repetitions: int = 3) -> str:
"""Imitate a real-world echo."""
echoed_text = ""
for i in range(repetitions, 0, -1):
echoed_text += f"{text[-i:]}\n"
return f"{echoed_text.lower()}."
echoes = [text[-i:].lower() for i in range(repetitions, 0, -1)]
return "\n".join(echoes + ["."])


if __name__ == "__main__":
Expand Down
6 changes: 2 additions & 4 deletions name-main-idiom/echo_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

def echo(text: str, repetitions: int = 3) -> str:
"""Imitate a real-world echo."""
echoed_text = ""
for i in range(repetitions, 0, -1):
echoed_text += f"{text[-i:]}\n"
return f"{echoed_text.lower()}."
echoes = [text[-i:].lower() for i in range(repetitions, 0, -1)]
return "\n".join(echoes + ["."])


def main() -> None:
Expand Down
6 changes: 2 additions & 4 deletions name-main-idiom/echo_demo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
def echo(text: str, repetitions: int = 3) -> str:
"""Imitate a real-world echo."""
echoed_text = ""
for i in range(repetitions, 0, -1):
echoed_text += f"{text[-i:]}\n"
return f"{echoed_text.lower()}."
echoes = [text[-i:].lower() for i in range(repetitions, 0, -1)]
return "\n".join(echoes + ["."])


if __name__ == "__main__":
Expand Down

0 comments on commit 1f2d2dd

Please sign in to comment.