Why does my recursive python function return None?












35















I have this piece of code that calls itself:



def Dat_Function():
my_var = raw_input("Type "a" or "b": ")

if my_var != "a" and my_var != "b":
print "You didn't type "a" or "b". Try again."
print " "
Dat_Function()
else:
print my_var, "-from Dat_Function"
return my_var


def main():
print Dat_Function(), "-From main()"

main()


Now, if I input just "a" or "b",everything is fine. The output is:



Type "a" or "b": a
a -from Dat_Function
a -From main()


But, if I type something else and then "a" or "b", I get this:



Type "a" or "b": purple
You didn't type "a" or "b". Try again.

Type "a" or "b": a
a -from Dat_Function
None -From main()


I don't know why Dat_Function() is returning None, since it should only return my_var. The print statement shows that my_var is the correct value, but the function doesn't return that value for some reason.










share|improve this question




















  • 7





    You need to do return Dat_Function() when calling it recursively.

    – Gustav Larsson
    Jul 22 '13 at 0:31






  • 2





    Just a tip: The idiomatic way of that my_var != "a" and my_var != "b" condition would be my_var not in ('a', 'b')

    – gonz
    May 18 '16 at 1:04
















35















I have this piece of code that calls itself:



def Dat_Function():
my_var = raw_input("Type "a" or "b": ")

if my_var != "a" and my_var != "b":
print "You didn't type "a" or "b". Try again."
print " "
Dat_Function()
else:
print my_var, "-from Dat_Function"
return my_var


def main():
print Dat_Function(), "-From main()"

main()


Now, if I input just "a" or "b",everything is fine. The output is:



Type "a" or "b": a
a -from Dat_Function
a -From main()


But, if I type something else and then "a" or "b", I get this:



Type "a" or "b": purple
You didn't type "a" or "b". Try again.

Type "a" or "b": a
a -from Dat_Function
None -From main()


I don't know why Dat_Function() is returning None, since it should only return my_var. The print statement shows that my_var is the correct value, but the function doesn't return that value for some reason.










share|improve this question




















  • 7





    You need to do return Dat_Function() when calling it recursively.

    – Gustav Larsson
    Jul 22 '13 at 0:31






  • 2





    Just a tip: The idiomatic way of that my_var != "a" and my_var != "b" condition would be my_var not in ('a', 'b')

    – gonz
    May 18 '16 at 1:04














35












35








35


7






I have this piece of code that calls itself:



def Dat_Function():
my_var = raw_input("Type "a" or "b": ")

if my_var != "a" and my_var != "b":
print "You didn't type "a" or "b". Try again."
print " "
Dat_Function()
else:
print my_var, "-from Dat_Function"
return my_var


def main():
print Dat_Function(), "-From main()"

main()


Now, if I input just "a" or "b",everything is fine. The output is:



Type "a" or "b": a
a -from Dat_Function
a -From main()


But, if I type something else and then "a" or "b", I get this:



Type "a" or "b": purple
You didn't type "a" or "b". Try again.

Type "a" or "b": a
a -from Dat_Function
None -From main()


I don't know why Dat_Function() is returning None, since it should only return my_var. The print statement shows that my_var is the correct value, but the function doesn't return that value for some reason.










share|improve this question
















I have this piece of code that calls itself:



def Dat_Function():
my_var = raw_input("Type "a" or "b": ")

if my_var != "a" and my_var != "b":
print "You didn't type "a" or "b". Try again."
print " "
Dat_Function()
else:
print my_var, "-from Dat_Function"
return my_var


def main():
print Dat_Function(), "-From main()"

main()


Now, if I input just "a" or "b",everything is fine. The output is:



Type "a" or "b": a
a -from Dat_Function
a -From main()


But, if I type something else and then "a" or "b", I get this:



Type "a" or "b": purple
You didn't type "a" or "b". Try again.

Type "a" or "b": a
a -from Dat_Function
None -From main()


I don't know why Dat_Function() is returning None, since it should only return my_var. The print statement shows that my_var is the correct value, but the function doesn't return that value for some reason.







python function recursion return






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 7 at 0:13









roippi

20.1k33253




20.1k33253










asked Jul 22 '13 at 0:29









CateCate

192127




192127








  • 7





    You need to do return Dat_Function() when calling it recursively.

    – Gustav Larsson
    Jul 22 '13 at 0:31






  • 2





    Just a tip: The idiomatic way of that my_var != "a" and my_var != "b" condition would be my_var not in ('a', 'b')

    – gonz
    May 18 '16 at 1:04














  • 7





    You need to do return Dat_Function() when calling it recursively.

    – Gustav Larsson
    Jul 22 '13 at 0:31






  • 2





    Just a tip: The idiomatic way of that my_var != "a" and my_var != "b" condition would be my_var not in ('a', 'b')

    – gonz
    May 18 '16 at 1:04








7




7





You need to do return Dat_Function() when calling it recursively.

– Gustav Larsson
Jul 22 '13 at 0:31





You need to do return Dat_Function() when calling it recursively.

– Gustav Larsson
Jul 22 '13 at 0:31




2




2





Just a tip: The idiomatic way of that my_var != "a" and my_var != "b" condition would be my_var not in ('a', 'b')

– gonz
May 18 '16 at 1:04





Just a tip: The idiomatic way of that my_var != "a" and my_var != "b" condition would be my_var not in ('a', 'b')

– gonz
May 18 '16 at 1:04












4 Answers
4






active

oldest

votes


















53














It is returning None because when you recursively call it:



if my_var != "a" and my_var != "b":
print "You didn't type "a" or "b". Try again."
print " "
Dat_Function()


..you don't return the value.



So while the recursion does happen, the return value gets discarded, and then you fall off the end of the function. Falling off the end of the function means that python implicitly returns None, just like this:



>>> def f(x):
... pass
>>> print(f(20))
None


So, instead of just calling Dat Function() in your if statement, you need to return it.






share|improve this answer


























  • Shouldn't it run through the if statement again if it is called recursively? I don't understand why it wouldn't return a value.

    – Cate
    Jul 22 '13 at 0:35











  • Nope. See my edit. The recursion happens, and then you discard what the recursion returns.

    – roippi
    Jul 22 '13 at 0:38











  • So if you call a function from inside that same function the return value gets discarded, but you return the same function in that function you really just call it in main()?

    – Cate
    Jul 22 '13 at 0:49








  • 1





    You lost me with that main() bit... You can fail as many times as you want to, the one that "succeeds" will return my_var, which will get passed down (returned) through all of the recursive calls all the way down to the original caller. Which, yes, is main().

    – roippi
    Jul 22 '13 at 0:54













  • I was thinking that when you return Dat_Function() you're really just calling Dat_Function() again in main(). Dat_Function() now returns a function and main() has go call it.

    – Cate
    Jul 22 '13 at 0:58





















6














To return a value other than None, you need to use a return statement.



In your case, the if block only executes a return when executing one branch. Either move the return outside of the if/else block, or have returns in both options.






share|improve this answer
























  • I've tried moving it out of the block, but to no avail. Instead of returning the correct value, it returns the first incorrect value. Also, I don't want a return statement for the if part of the if/else statement because I want the function to only return a correct value.

    – Cate
    Jul 22 '13 at 0:39



















3














def Dat_Function():
my_var = raw_input("Type "a" or "b": ")

if my_var != "a" and my_var != "b":
print "You didn't type "a" or "b". Try again."
print " "
return Dat_Function()
else:
print my_var, "-from Dat_Function"
return my_var


def main():
print Dat_Function(), "-From main()"

main()





share|improve this answer

































    -1














    I think that you should use while loops.




    if my_var != "a" and my_var != "b":
    print "You didn't type "a" or "b". Try again."
    print " "
    return Dat_Function()




    Consider that you type something different than "a" and "b", of course, it will call Dat_Function but then it is skipping the next part. Which is:




    else:
    print my_var, "-from Dat_Function"
    return my_var




    And will go directly into:




    def main():
    print Dat_Function(), "-From main()"




    So, if you use while loop as:




    while my_var!="a" and my_var!="b":
    print ('you didn't type a or b')
    return Dat_Function()




    This way I think that you can handle it.






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f17778372%2fwhy-does-my-recursive-python-function-return-none%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      53














      It is returning None because when you recursively call it:



      if my_var != "a" and my_var != "b":
      print "You didn't type "a" or "b". Try again."
      print " "
      Dat_Function()


      ..you don't return the value.



      So while the recursion does happen, the return value gets discarded, and then you fall off the end of the function. Falling off the end of the function means that python implicitly returns None, just like this:



      >>> def f(x):
      ... pass
      >>> print(f(20))
      None


      So, instead of just calling Dat Function() in your if statement, you need to return it.






      share|improve this answer


























      • Shouldn't it run through the if statement again if it is called recursively? I don't understand why it wouldn't return a value.

        – Cate
        Jul 22 '13 at 0:35











      • Nope. See my edit. The recursion happens, and then you discard what the recursion returns.

        – roippi
        Jul 22 '13 at 0:38











      • So if you call a function from inside that same function the return value gets discarded, but you return the same function in that function you really just call it in main()?

        – Cate
        Jul 22 '13 at 0:49








      • 1





        You lost me with that main() bit... You can fail as many times as you want to, the one that "succeeds" will return my_var, which will get passed down (returned) through all of the recursive calls all the way down to the original caller. Which, yes, is main().

        – roippi
        Jul 22 '13 at 0:54













      • I was thinking that when you return Dat_Function() you're really just calling Dat_Function() again in main(). Dat_Function() now returns a function and main() has go call it.

        – Cate
        Jul 22 '13 at 0:58


















      53














      It is returning None because when you recursively call it:



      if my_var != "a" and my_var != "b":
      print "You didn't type "a" or "b". Try again."
      print " "
      Dat_Function()


      ..you don't return the value.



      So while the recursion does happen, the return value gets discarded, and then you fall off the end of the function. Falling off the end of the function means that python implicitly returns None, just like this:



      >>> def f(x):
      ... pass
      >>> print(f(20))
      None


      So, instead of just calling Dat Function() in your if statement, you need to return it.






      share|improve this answer


























      • Shouldn't it run through the if statement again if it is called recursively? I don't understand why it wouldn't return a value.

        – Cate
        Jul 22 '13 at 0:35











      • Nope. See my edit. The recursion happens, and then you discard what the recursion returns.

        – roippi
        Jul 22 '13 at 0:38











      • So if you call a function from inside that same function the return value gets discarded, but you return the same function in that function you really just call it in main()?

        – Cate
        Jul 22 '13 at 0:49








      • 1





        You lost me with that main() bit... You can fail as many times as you want to, the one that "succeeds" will return my_var, which will get passed down (returned) through all of the recursive calls all the way down to the original caller. Which, yes, is main().

        – roippi
        Jul 22 '13 at 0:54













      • I was thinking that when you return Dat_Function() you're really just calling Dat_Function() again in main(). Dat_Function() now returns a function and main() has go call it.

        – Cate
        Jul 22 '13 at 0:58
















      53












      53








      53







      It is returning None because when you recursively call it:



      if my_var != "a" and my_var != "b":
      print "You didn't type "a" or "b". Try again."
      print " "
      Dat_Function()


      ..you don't return the value.



      So while the recursion does happen, the return value gets discarded, and then you fall off the end of the function. Falling off the end of the function means that python implicitly returns None, just like this:



      >>> def f(x):
      ... pass
      >>> print(f(20))
      None


      So, instead of just calling Dat Function() in your if statement, you need to return it.






      share|improve this answer















      It is returning None because when you recursively call it:



      if my_var != "a" and my_var != "b":
      print "You didn't type "a" or "b". Try again."
      print " "
      Dat_Function()


      ..you don't return the value.



      So while the recursion does happen, the return value gets discarded, and then you fall off the end of the function. Falling off the end of the function means that python implicitly returns None, just like this:



      >>> def f(x):
      ... pass
      >>> print(f(20))
      None


      So, instead of just calling Dat Function() in your if statement, you need to return it.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jul 22 '13 at 0:38

























      answered Jul 22 '13 at 0:31









      roippiroippi

      20.1k33253




      20.1k33253













      • Shouldn't it run through the if statement again if it is called recursively? I don't understand why it wouldn't return a value.

        – Cate
        Jul 22 '13 at 0:35











      • Nope. See my edit. The recursion happens, and then you discard what the recursion returns.

        – roippi
        Jul 22 '13 at 0:38











      • So if you call a function from inside that same function the return value gets discarded, but you return the same function in that function you really just call it in main()?

        – Cate
        Jul 22 '13 at 0:49








      • 1





        You lost me with that main() bit... You can fail as many times as you want to, the one that "succeeds" will return my_var, which will get passed down (returned) through all of the recursive calls all the way down to the original caller. Which, yes, is main().

        – roippi
        Jul 22 '13 at 0:54













      • I was thinking that when you return Dat_Function() you're really just calling Dat_Function() again in main(). Dat_Function() now returns a function and main() has go call it.

        – Cate
        Jul 22 '13 at 0:58





















      • Shouldn't it run through the if statement again if it is called recursively? I don't understand why it wouldn't return a value.

        – Cate
        Jul 22 '13 at 0:35











      • Nope. See my edit. The recursion happens, and then you discard what the recursion returns.

        – roippi
        Jul 22 '13 at 0:38











      • So if you call a function from inside that same function the return value gets discarded, but you return the same function in that function you really just call it in main()?

        – Cate
        Jul 22 '13 at 0:49








      • 1





        You lost me with that main() bit... You can fail as many times as you want to, the one that "succeeds" will return my_var, which will get passed down (returned) through all of the recursive calls all the way down to the original caller. Which, yes, is main().

        – roippi
        Jul 22 '13 at 0:54













      • I was thinking that when you return Dat_Function() you're really just calling Dat_Function() again in main(). Dat_Function() now returns a function and main() has go call it.

        – Cate
        Jul 22 '13 at 0:58



















      Shouldn't it run through the if statement again if it is called recursively? I don't understand why it wouldn't return a value.

      – Cate
      Jul 22 '13 at 0:35





      Shouldn't it run through the if statement again if it is called recursively? I don't understand why it wouldn't return a value.

      – Cate
      Jul 22 '13 at 0:35













      Nope. See my edit. The recursion happens, and then you discard what the recursion returns.

      – roippi
      Jul 22 '13 at 0:38





      Nope. See my edit. The recursion happens, and then you discard what the recursion returns.

      – roippi
      Jul 22 '13 at 0:38













      So if you call a function from inside that same function the return value gets discarded, but you return the same function in that function you really just call it in main()?

      – Cate
      Jul 22 '13 at 0:49







      So if you call a function from inside that same function the return value gets discarded, but you return the same function in that function you really just call it in main()?

      – Cate
      Jul 22 '13 at 0:49






      1




      1





      You lost me with that main() bit... You can fail as many times as you want to, the one that "succeeds" will return my_var, which will get passed down (returned) through all of the recursive calls all the way down to the original caller. Which, yes, is main().

      – roippi
      Jul 22 '13 at 0:54







      You lost me with that main() bit... You can fail as many times as you want to, the one that "succeeds" will return my_var, which will get passed down (returned) through all of the recursive calls all the way down to the original caller. Which, yes, is main().

      – roippi
      Jul 22 '13 at 0:54















      I was thinking that when you return Dat_Function() you're really just calling Dat_Function() again in main(). Dat_Function() now returns a function and main() has go call it.

      – Cate
      Jul 22 '13 at 0:58







      I was thinking that when you return Dat_Function() you're really just calling Dat_Function() again in main(). Dat_Function() now returns a function and main() has go call it.

      – Cate
      Jul 22 '13 at 0:58















      6














      To return a value other than None, you need to use a return statement.



      In your case, the if block only executes a return when executing one branch. Either move the return outside of the if/else block, or have returns in both options.






      share|improve this answer
























      • I've tried moving it out of the block, but to no avail. Instead of returning the correct value, it returns the first incorrect value. Also, I don't want a return statement for the if part of the if/else statement because I want the function to only return a correct value.

        – Cate
        Jul 22 '13 at 0:39
















      6














      To return a value other than None, you need to use a return statement.



      In your case, the if block only executes a return when executing one branch. Either move the return outside of the if/else block, or have returns in both options.






      share|improve this answer
























      • I've tried moving it out of the block, but to no avail. Instead of returning the correct value, it returns the first incorrect value. Also, I don't want a return statement for the if part of the if/else statement because I want the function to only return a correct value.

        – Cate
        Jul 22 '13 at 0:39














      6












      6








      6







      To return a value other than None, you need to use a return statement.



      In your case, the if block only executes a return when executing one branch. Either move the return outside of the if/else block, or have returns in both options.






      share|improve this answer













      To return a value other than None, you need to use a return statement.



      In your case, the if block only executes a return when executing one branch. Either move the return outside of the if/else block, or have returns in both options.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jul 22 '13 at 0:32









      SimonSimon

      611




      611













      • I've tried moving it out of the block, but to no avail. Instead of returning the correct value, it returns the first incorrect value. Also, I don't want a return statement for the if part of the if/else statement because I want the function to only return a correct value.

        – Cate
        Jul 22 '13 at 0:39



















      • I've tried moving it out of the block, but to no avail. Instead of returning the correct value, it returns the first incorrect value. Also, I don't want a return statement for the if part of the if/else statement because I want the function to only return a correct value.

        – Cate
        Jul 22 '13 at 0:39

















      I've tried moving it out of the block, but to no avail. Instead of returning the correct value, it returns the first incorrect value. Also, I don't want a return statement for the if part of the if/else statement because I want the function to only return a correct value.

      – Cate
      Jul 22 '13 at 0:39





      I've tried moving it out of the block, but to no avail. Instead of returning the correct value, it returns the first incorrect value. Also, I don't want a return statement for the if part of the if/else statement because I want the function to only return a correct value.

      – Cate
      Jul 22 '13 at 0:39











      3














      def Dat_Function():
      my_var = raw_input("Type "a" or "b": ")

      if my_var != "a" and my_var != "b":
      print "You didn't type "a" or "b". Try again."
      print " "
      return Dat_Function()
      else:
      print my_var, "-from Dat_Function"
      return my_var


      def main():
      print Dat_Function(), "-From main()"

      main()





      share|improve this answer






























        3














        def Dat_Function():
        my_var = raw_input("Type "a" or "b": ")

        if my_var != "a" and my_var != "b":
        print "You didn't type "a" or "b". Try again."
        print " "
        return Dat_Function()
        else:
        print my_var, "-from Dat_Function"
        return my_var


        def main():
        print Dat_Function(), "-From main()"

        main()





        share|improve this answer




























          3












          3








          3







          def Dat_Function():
          my_var = raw_input("Type "a" or "b": ")

          if my_var != "a" and my_var != "b":
          print "You didn't type "a" or "b". Try again."
          print " "
          return Dat_Function()
          else:
          print my_var, "-from Dat_Function"
          return my_var


          def main():
          print Dat_Function(), "-From main()"

          main()





          share|improve this answer















          def Dat_Function():
          my_var = raw_input("Type "a" or "b": ")

          if my_var != "a" and my_var != "b":
          print "You didn't type "a" or "b". Try again."
          print " "
          return Dat_Function()
          else:
          print my_var, "-from Dat_Function"
          return my_var


          def main():
          print Dat_Function(), "-From main()"

          main()






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 18 '16 at 0:59









          gonz

          3,58223149




          3,58223149










          answered May 17 '16 at 23:34









          user6348168user6348168

          391




          391























              -1














              I think that you should use while loops.




              if my_var != "a" and my_var != "b":
              print "You didn't type "a" or "b". Try again."
              print " "
              return Dat_Function()




              Consider that you type something different than "a" and "b", of course, it will call Dat_Function but then it is skipping the next part. Which is:




              else:
              print my_var, "-from Dat_Function"
              return my_var




              And will go directly into:




              def main():
              print Dat_Function(), "-From main()"




              So, if you use while loop as:




              while my_var!="a" and my_var!="b":
              print ('you didn't type a or b')
              return Dat_Function()




              This way I think that you can handle it.






              share|improve this answer




























                -1














                I think that you should use while loops.




                if my_var != "a" and my_var != "b":
                print "You didn't type "a" or "b". Try again."
                print " "
                return Dat_Function()




                Consider that you type something different than "a" and "b", of course, it will call Dat_Function but then it is skipping the next part. Which is:




                else:
                print my_var, "-from Dat_Function"
                return my_var




                And will go directly into:




                def main():
                print Dat_Function(), "-From main()"




                So, if you use while loop as:




                while my_var!="a" and my_var!="b":
                print ('you didn't type a or b')
                return Dat_Function()




                This way I think that you can handle it.






                share|improve this answer


























                  -1












                  -1








                  -1







                  I think that you should use while loops.




                  if my_var != "a" and my_var != "b":
                  print "You didn't type "a" or "b". Try again."
                  print " "
                  return Dat_Function()




                  Consider that you type something different than "a" and "b", of course, it will call Dat_Function but then it is skipping the next part. Which is:




                  else:
                  print my_var, "-from Dat_Function"
                  return my_var




                  And will go directly into:




                  def main():
                  print Dat_Function(), "-From main()"




                  So, if you use while loop as:




                  while my_var!="a" and my_var!="b":
                  print ('you didn't type a or b')
                  return Dat_Function()




                  This way I think that you can handle it.






                  share|improve this answer













                  I think that you should use while loops.




                  if my_var != "a" and my_var != "b":
                  print "You didn't type "a" or "b". Try again."
                  print " "
                  return Dat_Function()




                  Consider that you type something different than "a" and "b", of course, it will call Dat_Function but then it is skipping the next part. Which is:




                  else:
                  print my_var, "-from Dat_Function"
                  return my_var




                  And will go directly into:




                  def main():
                  print Dat_Function(), "-From main()"




                  So, if you use while loop as:




                  while my_var!="a" and my_var!="b":
                  print ('you didn't type a or b')
                  return Dat_Function()




                  This way I think that you can handle it.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 14 '18 at 16:37









                  asylturatbek dooranovasylturatbek dooranov

                  1




                  1






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f17778372%2fwhy-does-my-recursive-python-function-return-none%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to change which sound is reproduced for terminal bell?

                      Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                      Can I use Tabulator js library in my java Spring + Thymeleaf project?