```py def getlength(str:str)-> int: """Get the length of a string.""" i = 0 while True: try: str[i] except IndexError: return i - 1 finally: i += 1 ``` i know that len() is a function, i just decided to recreate it.
```py import typing def len2(seq: typing.Sequence) -> int: return sum(1 for _ in seq) ```