title: How to turn a float object into a list?
body: <p>I'm writing a script to return a number to a certain amount of significant figures. I need to turn a float into a list so that I can change the number easily. This is my code:</p>
  
  <pre><code>def sf(n,x):
      try:
          float(n)
          isnumber = True
      except ValueError:
          isnumber = False
      if isnumber == True:
          n = float(n)
          n = list(n)
          print(n)
      else:
          print("The number you typed isn't a proper number.")
  sf(4290,2)
  </code></pre>
  
  <p>This returns the error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/Users/jacobgarby/PycharmProjects/untitled/py package/1.py", line 29, in &lt;module&gt;
  sf(4290,2)
  File "/Users/jacobgarby/PycharmProjects/untitled/py package/1.py", line 25, in sf
  n = list(n)
  TypeError: 'float' object is not iterable
  </code></pre>
  
  <p>What does this error mean, and how can I stop it from happening?</p>