fork download
  1. # your code goes here
  2. def transform_line(line):
  3. lines = []
  4. while line != "":
  5. if line.find("1")!=-1:
  6. print("O")
  7. line = next(osrc);
  8. lines.append(line)
  9. elif line.find("+")!=-1:
  10. print("U")
  11. line = next(osrc);
  12. lines.append(line)
  13. elif line.find("-")!=-1:
  14. print("U")
  15. line = next(osrc);
  16. lines.append(line)
  17. else:
  18. print("nope")
  19. break;
  20. return lines
  21.  
  22. with open("./testStage1.txt", 'r') as osrc:
  23. osrc.seek(291)
  24. line = next(osrc);
  25. lines = transform_line(line)
  26. print "\n".join(lines)
Runtime error #stdin #stdout #stderr 0.01s 7892KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 22, in <module>
IOError: [Errno 2] No such file or directory: './testStage1.txt'