importしたファイルの変数の使用がわからないです。(初心者)
今、test.pyに
import test2 print a
と、
test2.pyに
a = ["HELLO","WORLD"] print a
と書きました。
python test.pyとコンソールに入力すると
['HELLO', 'WORLD']
Traceback (most recent call last):
File "test.py", line 3, in <module>
print a
NameError: name 'a' is not defined
とエラーが出ました。
test.pyでaを呼び出すにはどう書き換えたら良いのでしょうか?
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。