Created
July 15, 2022 19:18
-
-
Save asukaminato0721/29d89f3d3e2bf9b4fc37b19ac9d21543 to your computer and use it in GitHub Desktop.
make iostream in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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