Mar-17-2022, 03:48 PM
(This post was last modified: Mar-17-2022, 03:49 PM by DeaD_EyE.
Edit Reason: renamed value to text
)
Example with use of walrus operator
:=
def shortest_str(text_list: list[str]) -> tuple[str, int]: """ Return the shortest str with index as tuple. """ return (text := min(text_list, key=len)), text_list.index(text)
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!