Python Essentials Classroom Series – 07/Aug/2021

Writing and Importing our Modules

  • Refer Here for the module imports demo.

  • Exercise:

    • Create a new folder called as experiment.
    • In this folder create three python modules
      • main.py (This should be script)
      • numeric.py
      • text.py
    • In numeric.py write two functions
      • is_even
      • is_pallendrome
    • In text.py write two functions
      • reverse : “`’Helloworld'[::-1]
    • Demonstrate using numeric module with import statement
    • Demonstrate usage of reverse in text.py with from import statement
    • Ensure docstrings are added.
  • Some more import statement

  • Python has a Standard Libarary and we can reuse the standary library modules with import statements. Refer Here for some sample usage of math and datetime modules

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin