Horje
reject invalid input using a loop in python Code Example
reject invalid input using a loop in python
take input
while incorrect input:
    take input
    
#Eg. Taking the month input for the first quarter of the year.
months = ['january', 'february', 'march']
month = input('Select the month').lower()
while month not in months:
  month = input('Oops! Incorrect input. Select month again').lower()
  

  




Python

Related
polynomial features random forest classifier Code Example polynomial features random forest classifier Code Example
dataframe describe in pandas problems Code Example dataframe describe in pandas problems Code Example
python primera letra mayuscula Code Example python primera letra mayuscula Code Example
python pil invert image color Code Example python pil invert image color Code Example
python json indented Code Example python json indented Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10