Simplifying / optimizing a chain of for-loops By Admin

I have a chain of for-loops that works on an original list of strings and then gradually filtering the list as it goes down the chain, e.g.:

import re

# Regex to check that a cap exist in string.
pattern1 = re.compile(r'\d.*?[A-Z].*?[a-z]')
vocab = ['dog', 'lazy', 'the', 'fly'] # Imagine it's a longer list.

def check_no_caps(

  •  Open
  •  27-07-2016
  •  0
  •  283

Answers ( 0 )

No Answer Found.