This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = 0 | |
for i in range(1,11): | |
with open("numbers.txt", 'a') as f: #with構文という便利な物がある。オプションのaは追記を意味する | |
f.write('hello, world\n') #文末に\n(macbookだとalt+¥)を入れると改行になる |
printがprint()という関数になっていたこと、openで引数aを入れないと上書きされてしまう初歩的なことも忘れてしまっていた。めげずにpython書き続けよう。
No Comment to " Python3.6.1を使い始めて戸惑ったこと。 "