title: How can I limit user input length on python?
body: <pre><code>amt = float(input("Please enter the amount to make change for: $"))
  </code></pre>
  
  <p>I'd like the user to enter an amount in dollars and therefore allow 5 characters (00.00) Is there a way to limit it so it wont allow them to enter more than 5 characters?</p>
  
  <p>I don't want something like this where it allows you to input more than 5 but will loop.</p>
  
  <pre><code>while True:
  amt = input("Please enter the amount to make change for: $")
  if len(amt) &lt;= 5:
          print("$" + amt)
          break
  </code></pre>
  
  <p>I want complete restriction from entering more than 5 characters</p>