Can I use a separate function for inquirer validate function or it has to be lambda function?
I'm trying to ask a question about shift count. So I have to check it's number or not.
I wrote a function that checks its argument number or not and returns a boolean value.
import inquirer
import string
def shiftCount(count):
for i in count:
if i in string.digits:
pass
else:
return False
return True
question = [
inquirer.Text('count', message='Enter a number',validate=???)
]
answers = inquirer.prompt(questions)
I know that validate function must take two arguments. But I couldn't manage to write it down.