title: How to set the data type of a function parameter in python?
body: <pre><code>
  def recursiveSum(lst):
      if len(lst) == 0:
          return 0
      else:
          #print(str(type(lst))+'\n')    
          num = lst[len(lst)-1]
          return recursiveSum(lst.pop()) + num
  
  
  size = int(input(&quot;How many number do you want to enter? = &quot;))
  lst=[]
  for i in range(size):
      lst.append(input(&quot;Enter number &quot;+str(i+1)+&quot; = &quot; ))
  print(recursiveSum(lst))
  </code></pre>
  <p>In this code i am trying to find sum of list of numbers recursively , this is my first attempt with recursions , i think my approach and algorithm was correct , the list when passed to the <strong>recursiveSum()</strong> function somehow makes it string in the <strong>else</strong> part , the commented line when executed ends up printing</p>
  <blockquote>
  <p>class 'list'</p>
  <p>class 'str'</p>
  </blockquote>
  <p>I don't understand how the print statement prints both <strong>list</strong> and <strong>str</strong>.</p>
  <p>Can someone explain this ?</p>