回答編集履歴

1

追記

2018/10/19 11:58

投稿

katoy
katoy

スコア22324

test CHANGED
@@ -41,3 +41,51 @@
41
41
  実行例
42
42
 
43
43
  ![イメージ説明](6c8ecc41d4f38ac0198538c8f3df7e30.png)
44
+
45
+
46
+
47
+ 追記:
48
+
49
+ for python2
50
+
51
+ ```python
52
+
53
+ import sys
54
+
55
+
56
+
57
+ start_pos = 4
58
+
59
+ empty_lines = 4
60
+
61
+
62
+
63
+ count = 0
64
+
65
+ while True:
66
+
67
+ line = sys.stdin.readline()
68
+
69
+ if line == '':
70
+
71
+ break
72
+
73
+
74
+
75
+ count += 1
76
+
77
+ sys.stdout.write(line)
78
+
79
+ if count == start_pos:
80
+
81
+ for x in range(empty_lines):
82
+
83
+ ```
84
+
85
+
86
+
87
+ 参考情報
88
+
89
+ Python Tips:改行なしで文字列を出力したい
90
+
91
+ [https://www.lifewithpython.com/2013/12/python-print-without-.html](https://www.lifewithpython.com/2013/12/python-print-without-.html)