fork download
  1. import sys
  2. from io import StringIO
  3.  
  4.  
  5. class Ostream:
  6. def __init__(self, out: StringIO):
  7. self.out = out
  8.  
  9. def __lshift__(self, other):
  10. self.out.write(str(other))
  11. return self
  12.  
  13.  
  14. cout = Ostream(sys.stdout)
  15. endl = "\n"
  16.  
  17. cout << "Hello, World!" << endl;
  18.  
Success #stdin #stdout 0.02s 9304KB
stdin
Standard input is empty
stdout
Hello, World!