Thanks all! This helps a lot.
On Jul 1, 2011, at 6:13 AM, Steven D'Aprano wrote:
> Ryan Kirk wrote:
>> Is there a way to limit raw_input to the hundredth decimal point?
>
> No. raw_input is a tool that does one thing: it collects input from the user.
> It doesn't understand numbers, check for d
Ryan Kirk wrote:
Is there a way to limit raw_input to the hundredth decimal point?
No. raw_input is a tool that does one thing: it collects input from the
user. It doesn't understand numbers, check for decimal places, check the
input for spelling errors, or anything else. It's a hammer, not a
On 2011/07/01 09:30 AM, Ryan Kirk wrote:
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!
___
Tutor m
You can use a regular expression or plain simple len()
2011/7/1 Ryan Kirk
> 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!
>
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!
___
Tutor maillist - Tutor@python.org
To unsubscribe