0
How to use regular expressions to evaluate case insensitive word input
I want to make input() parse an any character yes/no so that if the input is 'Yes' or 'yes' or even 'YES' I can write an if statement for it. Using python.
2 odpowiedzi
+ 1
if re.findall('(?i)yes', inp):
do some stuff
+ 1
Thank you Vitaly Sokol . That enabled me to write this: https://code.sololearn.com/cZmcAJtgrqe9/?ref=app