回答編集履歴

1

改行文字の削除

2019/06/28 09:41

投稿

kazuma-s
kazuma-s

スコア8224

test CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  while (p != None):
20
20
 
21
- print("{:>2d} {} {}\n".format(p.number, p.name, p.profile))
21
+ print("{:>2d} {} {}".format(p.number, p.name, p.profile))
22
22
 
23
23
  p = p.next
24
24
 
@@ -137,3 +137,17 @@
137
137
  p はその 1行の内容で、str です。
138
138
 
139
139
  str に number という attribute はありません。
140
+
141
+
142
+
143
+ ### 追記
144
+
145
+ print_info の中の print で余計な "\n" があったので削除しました。
146
+
147
+ search の中で、print() により空行を出していたのをその直前の
148
+
149
+ print の書式を "{:>2d} {} {}\n" にして、print() を削除したとき、
150
+
151
+ print_info の print も同じ書式にしようとコピペしたため
152
+
153
+ このバグが入ってしまいました。