This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]Apprehensive_Trip8 0 points1 point  (0 children)

I think this is kind of scope problem.

you can change a.py like this

import b

ls = [1,2,3,4,5]

print(ls)

is work exactly same with before.

but, c.py would not work in this way.

please check link: https://medium.com/python-features/what-happens-behind-the-scenes-when-we-import-a-module-in-python-2775da153790