Skip to content

Commit

Permalink
new challenge: empty-tuple (intermediate) (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
F-park authored Jan 19, 2024
1 parent 84551ad commit dba821e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions challenges/intermediate-empty-tuple/hints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check out [annotating-tuples](https://docs.python.org/zh-cn/3/library/typing.html#annotating-tuples)
14 changes: 14 additions & 0 deletions challenges/intermediate-empty-tuple/question.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
TODO:
foo should accept a empty tuple argument.
"""


def foo(x):
pass


## End of your code ##
foo(())
foo((1)) # expect-type-error
14 changes: 14 additions & 0 deletions challenges/intermediate-empty-tuple/solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
TODO:
foo should accept a empty tuple argument.
"""


def foo(x: tuple[()]):
pass


## End of your code ##
foo(())
foo((1)) # expect-type-error

0 comments on commit dba821e

Please sign in to comment.