Skip to content

Instantly share code, notes, and snippets.

@asukaminato0721
Created July 15, 2022 19:18
Show Gist options
  • Save asukaminato0721/29d89f3d3e2bf9b4fc37b19ac9d21543 to your computer and use it in GitHub Desktop.
Save asukaminato0721/29d89f3d3e2bf9b4fc37b19ac9d21543 to your computer and use it in GitHub Desktop.
make iostream in python
class _cout:
def __lshift__(self, x):
print(x, end="")
return self
class _cin:
def __rshift__(self, x):
globals()[x] = input()
return self
cout = _cout()
cout << 4 << 5 << 6 << 7 << "\n"
cin = _cin()
cin >> "a" >> "b" >> "c" >> "d"
print(a, b, c, d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment