strtools.py and the program main.py sit in the same folder. The program lists the module's names with dir().
strtools.py:
def shout(s):
return _clean(s).upper()
def _clean(s):
return s.strip()
VOWELS = "aeiou"
main.py:
import strtools
names = [n for n in dir(strtools) if not n.startswith("__")]
print(names, strtools.shout(" hey "))
What does main.py print?Log in to join the discussion.
Loading…