回答編集履歴
1
追記
answer
CHANGED
@@ -8,4 +8,21 @@
|
|
8
8
|
[io --- ストリームを扱うコアツール](https://docs.python.org/ja/3/library/io.html#io.TextIOBase)
|
9
9
|
**read(size=-1)**
|
10
10
|
最大 size 文字をストリームから読み込み、一つの str にして返します。
|
11
|
-
size が負の値または None ならば、 EOF まで読みます。
|
11
|
+
size が負の値または None ならば、 EOF まで読みます。
|
12
|
+
|
13
|
+
```Python
|
14
|
+
>>> import sys
|
15
|
+
>>>
|
16
|
+
>>> type(sys.stdin)
|
17
|
+
<class '_io.TextIOWrapper'>
|
18
|
+
>>>
|
19
|
+
>>> help(sys.stdin.read)
|
20
|
+
Help on built-in function read:
|
21
|
+
|
22
|
+
read(size=-1, /) method of _io.TextIOWrapper instance
|
23
|
+
Read at most n characters from stream.
|
24
|
+
|
25
|
+
Read from underlying buffer until we have n characters or we hit EOF.
|
26
|
+
If n is negative or omitted, read until EOF.
|
27
|
+
|
28
|
+
```
|