Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Using Python's Input Function with Numbers

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
106 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon
Ratings have been disabled for this video.

Uploaded by on Jan 14, 2012

We show how to use Python's input function to get numbers, without the program breaking if something other than a number is entered.

Link to this comment:

Share to:
see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • @xCyph0nx Yes, Python 3. Using input() in Python 2 is dangerous, as it evaluates whatever argument is given.

  • Are you using Python 3? Because I'm pretty sure input() grabs a number in 2.7.x.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more