関数を呼び出していないからでは。
Python
1>>> # もちろん、こんなコードはエラーになる
2... hogeeeeeeeeee
3Traceback (most recent call last):
4 File "<stdin>", line 2, in <module>
5NameError: name 'hogeeeeeeeeee' is not defined
6>>>
7>>> # ただし、関数の中に置いた場合は看過される
8... def func():
9... hogeeeeeeeeeeeee
10...
11>>> # 呼び出したとき、初めてエラーが出る
12... func()
13Traceback (most recent call last):
14 File "<stdin>", line 2, in <module>
15 File "<stdin>", line 3, in func
16NameError: name 'hogeeeeeeeeeeeee' is not defined
ただし、ご提示の関数の内容自体はバグなく書けていると思いますよ。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/03 14:31
2018/09/03 15:05 編集
2018/09/03 14:35