>>> s = '12abcd405' >>> result = ''.join([i for i in s if not i.isdigit()]) >>> result 'abcd'

Read more of this post