recursion with or without return statement : <p>this is the problem I solved for recursion<br/></p>

<blockquote>
  <p>phone_book    return <br/>
  [119, 97674223, 1195524421] false  <br/>
  [123,456,789] true <br/>
  [12,123,1235,567,88]  false</p>
</blockquote>

<p>when it have the prefix of the any number it will return false <br/>
anyway here is my solution <br/></p>

<pre><code>def solution(phone_book):
    answer = True
    arr = []    
    print(phone_book,len(phone_book))
    if len(phone_book) &lt;=1: return True
    phone_book.sort(key = lambda s: len(str(s)))
    length = len(str(phone_book[0]))
    for  st in phone_book[1:]:
        if phone_book[0] == st[:length]: return False
    return solution(phone_book[1:])
</code></pre>

<p>but for last recursion part <br/>
if I remove the return it return the None value <br/>
I want to know why it return the None value <br/></p>

<blockquote>
<pre><code>     solution(phone_book[1:])  ---&gt; this will return None value without return statemetn
</code></pre>
</blockquote>
