-1

i want to calculate sum of every digit. For example, if we have number 134,we calculate 1+3+4 =8 and print it out. I did this in c, it works fine but when i try it in python it doesn't work. Here is my code: python code

  • 2
    Please include the code in your question itself. Do not paste pictures of your code. See [how to ask ?](https://stackoverflow.com/help/how-to-ask) – Imanpal Singh May 12 '20 at 15:32
  • I dont have internet connection on my pc at the moment. Im writing from my phone – Mehmetali Karadağ May 12 '20 at 15:33
  • 1
    Does this answer your question? [Why does my recursive function return None?](https://stackoverflow.com/questions/17778372/why-does-my-recursive-function-return-none) – Mark Dickinson May 12 '20 at 16:55

1 Answers1

1

the problem in your code is that it has no return statement; by default, Python will return None.

That being said, I would recommend you to add the code to the question in the next questions; just as skrrrt commented :).