About 136,000 results
Open links in new tab
  1. python - Asking the user for input until they give a valid response ...

    Apr 25, 2014 · To handle numeric input with validation and retries, consider using the int_input function from the typed-input 1 library (other functions like float_input, decimal_input, and …

  2. python - Most Pythonic way to do input validation - Stack Overflow

    3 The most Pythonic way to do this kind of validation of "User INput" is to catch an appropriate exception. Example:

  3. python - Correct approach to validate attributes of an instance of ...

    It is compliant with python 2 and 3.5 (as opposed to pydantic), and validation happens everytime the value is changed (not only the first time, as opposed to attrs).

  4. validation - In Python, is there a way to validate a user input in a ...

    Apr 1, 2012 · In Python, is there a way to validate a user input in a certain format? [duplicate] Asked 13 years, 8 months ago Modified 9 years, 11 months ago Viewed 17k times

  5. python - Validate user input using regular expressions - Stack …

    Nov 24, 2015 · Validate user input using regular expressions Asked 10 years ago Modified 1 year, 8 months ago Viewed 21k times

  6. Validating user input strings in Python - Stack Overflow

    Sep 11, 2016 · Validating user input strings in Python Asked 12 years, 6 months ago Modified 3 years, 6 months ago Viewed 57k times

  7. python - Validating an input using a simple while loop - Stack …

    I want to validate an input to only accept 0s or 1s using a while loop. I would like to use the Boolean "OR," so while the input is not equal to 1 or 0, print an error and insist that the user …

  8. Python: Argument Parsing Validation Best Practices

    Is it possible when using the argparse module to add validation when parsing arguments? from argparse import ArgumentParser parser = ArgumentParser(description='Argument parser for …

  9. Python input validity and using asserts - Stack Overflow

    Python input validity and using asserts Asked 13 years, 3 months ago Modified 5 years, 2 months ago Viewed 9k times

  10. validation - How to validate an integer with python that needs to …

    Nov 28, 2022 · After changing the NumCars input to a string, I validated with isdigit, and then when I needed the variable for the calculations, I converted it to integers at the instances …