Skip to content

Commit

Permalink
update simonsays lab
Browse files Browse the repository at this point in the history
  • Loading branch information
rambasnet committed Oct 10, 2023
1 parent 493490c commit eb70f87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Ch05-Iterations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
4 changes: 3 additions & 1 deletion labs/strings/simonsays/simonsays.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
3. If it does, print the rest of the string after 'Simon says', otherwise ignore the string
"""

from typing import Union


def main():
"""Main function that solves the problem.
Expand Down Expand Up @@ -41,7 +43,7 @@ def valid_command(command: str) -> bool:
return ans


def answer(command: str) -> str | None:
def answer(command: str) -> Union[str, None]:
"""Returns answer given the command or None if the command is not valid.
Args:
Expand Down

0 comments on commit eb70f87

Please sign in to comment.