fork download
  1. s=list("ababaab")
  2.  
  3. for i,v in enumerate(s):
  4. if("a" not in s and "b" not in s):
  5. print("invalid")
  6. break
  7. if(v=="a" and s[i+1]=="a" and s[i+2]=="b"):
  8. print("Target Match")
  9. var = ' '.join(s[i:i+3])
  10. print(var)
  11. break
Success #stdin #stdout #stderr 0.03s 6772KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/BfajXp/prog:11:12: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit