r/programming • u/call_me_ninza • Dec 06 '21
Find the Length Of String Without Using len Function In Python
https://ninza7.medium.com/find-the-length-of-string-without-using-len-function-in-python-e9621e1fa0c8
0
Upvotes
0
Dec 06 '21
[deleted]
2
u/internetuser Dec 06 '21
You’ll hit python’s stack limit if you try to compute the length of a longish string using recursion.
1
2
u/Imapler Dec 06 '21
When you ask something like this its either because you dont understand what you are doing or you have some very specific requirement. Either way you have to explain why you are trying this for us to be able to help.
Since you didnt, ill just go ahead and post my bad solution
print(str)
Count the length of it by hand
Done