String parsing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

String parsing

How do I return true if all letters, in order, even though it is capital or not are in a string?

4th Oct 2019, 9:21 PM
Smart
1 Answer
0
def checkstring(mystring): if list(mystring.replace(' ', '').lower()) == sorted(mystring.replace(' ', '').lower()): return True else: return False mystring = 'Abc eFG' print(checkstring(mystring))
5th Oct 2019, 2:18 AM
rodwynnejones
rodwynnejones - avatar