回答編集履歴

1

誤字とコメントを微修正

2018/06/06 10:36

投稿

ponpu1601
ponpu1601

スコア166

test CHANGED
@@ -70,19 +70,11 @@
70
70
 
71
71
  with open("st.txt", "w") as writer:
72
72
 
73
- #ファイルに書き込む
74
-
75
73
  writer.write("Hi from Python")
76
-
77
- #ファイルを閉じる(withステートメント通過で自動で閉じられる)
78
74
 
79
75
 
80
76
 
81
- #ファイルを操作するオブジェクトに「f」という名前を付けてst.txtファイルを開く
82
-
83
77
  with open("st.txt", "r") as reader:
84
-
85
- #ファイルを読み込んだ結果を変数に格納
86
78
 
87
79
  my_list.append(reader.read())
88
80