 <p>The problem is exactly what the Traceback log says: <code>Could not convert string to float</code></p> <ul> <li>If you have a string with only numbers, python's smart enough to do what you're trying and converts the string to a float.</li> <li>If you have a string with non-numerical characters, the conversion will fail and give you the error that you were having.</li> </ul> <p>The way most people would approach this problem is with a <code>try/except</code> (see <a href="http://docs.python.org/3/tutorial/errors.html" rel="nofollow">here</a>), or using the <code>isdigit()</code> function (see <a href="http://www.tutorialspoint.com/python/string_isdigit.htm" rel="nofollow">here</a>).</p> <p><strong>Try/Except</strong></p> <pre><code>try: miles = float(input("How many miles can you walk?: ")) except: print("Please type in a number!") </code></pre> <p><strong>Isdigit()</strong></p> <pre><code>miles = input("How many miles can you walk?: ") if not miles.isdigit(): print("Please type a number!") </code></pre> <p>Note that the latter will still return false if there are decimal points in the string</p> <h2>EDIT</h2> <p>Okay, I won't be able to get back to you for a while, so I'll post the answer just in case.</p> <pre><code>while True: try: miles = float(input("How many miles can you walk?: ")) break except: print("Please type in a number!") #All of the ifs and stuff </code></pre> <p>The code's really simple:</p> <ul> <li>It will keep trying to convert the input to a float, looping back to the beginning if it fails.</li> <li>When eventually it succeeds, it'll break from the loop and go to the code you put lower down.</li> </ul>