[Tutor] Limit raw_input to hundredth decimal point

Ryan Kirk ryankirk at me.com
Fri Jul 1 09:30:16 CEST 2011


Is there a way to limit raw_input to the hundredth decimal point?

For example, I'd like to allow the user to enter 5.75 but not 5.756:

dollars = raw_input("Please enter a dollar amount: $")

Thanks!


More information about the Tutor mailing list