質問するログイン新規登録

回答編集履歴

1

追記

2018/10/19 11:58

投稿

katoy
katoy

スコア22328

answer CHANGED
@@ -19,4 +19,28 @@
19
19
  ```
20
20
 
21
21
  実行例
22
- ![イメージ説明](6c8ecc41d4f38ac0198538c8f3df7e30.png)
22
+ ![イメージ説明](6c8ecc41d4f38ac0198538c8f3df7e30.png)
23
+
24
+ 追記:
25
+ for python2
26
+ ```python
27
+ import sys
28
+
29
+ start_pos = 4
30
+ empty_lines = 4
31
+
32
+ count = 0
33
+ while True:
34
+ line = sys.stdin.readline()
35
+ if line == '':
36
+ break
37
+
38
+ count += 1
39
+ sys.stdout.write(line)
40
+ if count == start_pos:
41
+ for x in range(empty_lines):
42
+ ```
43
+
44
+ 参考情報
45
+ Python Tips:改行なしで文字列を出力したい
46
+ [https://www.lifewithpython.com/2013/12/python-print-without-.html](https://www.lifewithpython.com/2013/12/python-print-without-.html)