fork download
  1. while True:
  2. mes = input('Digite o mês inicial:')
  3. if len(mes) == 2:
  4. break;
  5. print ('Valor inválido! O mês deve ter 2 dígitos.')
  6. mes1 = int(mes)
  7. print(mes1)
  8.  
  9. #https://pt.stackoverflow.com/q/418413/101
Success #stdin #stdout 0.02s 9372KB
stdin
02
stdout
Digite o mês inicial:2