diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..6b76b4f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python Debugger: Current File", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal" + } + ] +} \ No newline at end of file diff --git a/__pycache__/playing_cards.cpython-313.pyc b/__pycache__/playing_cards.cpython-313.pyc new file mode 100644 index 0000000..476e6c4 Binary files /dev/null and b/__pycache__/playing_cards.cpython-313.pyc differ diff --git a/pop_list.py b/pop_list.py new file mode 100644 index 0000000..db137bc --- /dev/null +++ b/pop_list.py @@ -0,0 +1,12 @@ +from typing import List, Tuple + +Card = Tuple[str, str] # ('Rank', 'Suit') +Hand = List[Card] + +def pop_list(lst: List, index: int) -> Tuple: + """Removes and returns the element at the specified index from the list.""" + if index < 0 or index >= len(lst): + raise IndexError("Index out of range") + element = lst[index] + lst.remove(element) + return element