How to make python case insensitive | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 5

How to make python case insensitive

Suppose we have a variable of value "variable". We have to make it case insensitive so that the input can equal the value in any case.Like in this example pls hlp https://code.sololearn.com/c5gZqTsBcGOp/?ref=app

3rd May 2018, 5:52 AM
į³oʊoŌ²įŽ®c !
į³oʊoŌ²įŽ®c ! - avatar
5 Respostas
+ 20
First watch this Video: https://www.bing.com/videos/search?q=how+to+make+JUMP_LINK__&&__python__&&__JUMP_LINK+case+insensitive&qpvt=how+to+make+python+case+insensitive&view=detail&mid=59BEBF5235B1BD7AA73C59BEBF5235B1BD7AA73C&&FORM=VRDGAR Second, Assuming ASCII strings: string1 = 'Hello' string2 = 'hello' if string1.lower() == string2.lower(): print "The strings are the same (case insensitive)" else: print "The strings are not the same (case insensitive)" SOURCE: https://stackoverflow.com/questions/319426/how-do-i-do-a-case-insensitive-string-comparison
3rd May 2018, 7:19 AM
Baraa AB
Baraa AB - avatar
+ 19
GodOfPC 611 most welcome bro šŸ’™ Good luck šŸ˜‰šŸ’š
3rd May 2018, 12:21 PM
Baraa AB
Baraa AB - avatar
+ 8
Rahul George : since there exists a challenge for it: casefold() as a further opportunity
3rd May 2018, 7:57 AM
Oma Falk
Oma Falk - avatar
+ 7
Thanks Baraa AB I got the point , pretty easy thoughšŸ˜šŸ‘ words will remain same in lowercase So it can be case insensitive šŸ‘
3rd May 2018, 7:46 AM
į³oʊoŌ²įŽ®c !
į³oʊoŌ²įŽ®c ! - avatar
+ 5
You could possibly make use of the "your string".upper(), " your string".lower() or "your string". title() functions... https://www.google.co.in/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/q/27770573&ved=2ahUKEwjdmImT9OjaAhWMKo8KHSuOAiEQFjADegQIBRAB&usg=AOvVaw3z5hbCWYsUF5HOewPIzNl1
3rd May 2018, 6:25 AM
Rahul George
Rahul George - avatar