- 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
2 Respostas
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