Advertisement
Guest User

try

a guest
Oct 31st, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. import re
  2. cmp=re.compile(r'^(LG)*$|^(GL)*$|^[LR]*$|^(RG)*$|^(GR)*$')
  3. mtch=cmp.match(command)
  4. if mtch:
  5.     if mtch.group()==command:
  6.     return "YES"
  7. else:
  8.     return "NO"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement