fork(1) download
  1. import re
  2. lines = ["Where_can_i_find red capture state",
  3. "Why_are_you orange 00:AO state",
  4. "Salty_pepper gray good state",]
  5. for line in lines:
  6. if line.strip().endswith('state') and any(line.strip().startswith(x) for x in ['Where_can_i_find','Salty_pepper']):
  7. print(line.split()[-2])
  8.  
Success #stdin #stdout 0.03s 9480KB
stdin
Standard input is empty
stdout
capture
good