kit there are two files: an __init__.py that sets a version number, and a module conv.py. The program main.py is next to that folder.
kit/__init__.py:
VERSION = 1
kit/conv.py:
def triple(n):
return n * 3
main.py:
import kit
try:
print(kit.conv.triple(4))
except AttributeError:
import kit.conv
print(kit.conv.triple(4), kit.conv.__name__)
What does main.py print?Log in to join the discussion.
Loading…