title: How can I include decimals in my output as well?
body: <p>So here's a piece of code that returns all numbers within a given string <code>s</code>.</p>
  <pre><code>def getDigits(s):
      answer = []
      for char in s.split(&quot;;&quot;):
          k = &quot;&quot;
          for split_s in char:
              if split_s.isdigit():
                  k += split_s
          if k:
              answer.append(k)
      return answer
  </code></pre>
  <p>However, if the input <code>s = 'hiking;time:106,01;distance:8.29'</code> is provided, for <code>distance:8.29</code>, the code returns 829 without the decimal point. How can I change my code so that if there is a decimal point in a number, the decimal point gets returned as well??</p>