{"id":4674,"date":"2022-08-13T10:19:38","date_gmt":"2022-08-13T10:19:38","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=4674"},"modified":"2022-08-13T10:20:37","modified_gmt":"2022-08-13T10:20:37","slug":"what-are-modules-and-packages-in-python","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/","title":{"rendered":"What are modules and packages in Python ?"},"content":{"rendered":"<ul>\n<li style=\"text-align: justify;\">It is often that programmers and many coders may confuse between a module and a package.<\/li>\n<li style=\"text-align: justify;\">Generally, arises when it becomes hard to identify when and where a package or module should be implemented.<\/li>\n<li style=\"text-align: justify;\">In python programming language module and packages will make it easy for the programmers to work more professionally while dealing with both modules and packages.<\/li>\n<\/ul>\n<h2 id=\"modules\" style=\"text-align: justify;\"><strong>Modules<\/strong><\/h2>\n<ul style=\"text-align: justify;\">\n<li>A module is a pythonic statement that containing different functions.<\/li>\n<li>Modules are act as a pre-defined library in the script, which is accessible to both the programmers as well as the user.<\/li>\n<li>These modules are also store pre-defined functions from the library where the code is being executed.<\/li>\n<\/ul>\n<h3 id=\"sample-code\" style=\"text-align: justify;\"><strong>Sample Code<\/strong><\/h3>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-python code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-python code-embed-code\"># importing the library and module  <br\/>import math  <br\/>from math import pow  <br\/># using the pow() function  <br\/>pow(3, 5)  <br\/># printing pow()  <br\/>print(pow)  <\/code><\/pre> <\/div>\n<h3 id=\"output\" style=\"text-align: justify;\"><strong>Output<\/strong><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-4675\" src=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules.png\" alt=\"\" width=\"1434\" height=\"169\" srcset=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules.png 1434w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules-300x35.png 300w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules-1024x121.png 1024w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules-768x91.png 768w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules-390x46.png 390w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules-820x97.png 820w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules-1180x139.png 1180w\" sizes=\"(max-width: 1434px) 100vw, 1434px\" \/><\/h3>\n<h2 id=\"packages\" style=\"text-align: justify;\"><strong>Packages<\/strong><\/h2>\n<ul style=\"text-align: justify;\">\n<li>A package is considered as a collection of tools that allows the programmers to initiate the code.<\/li>\n<li>Python package acts as a user-variable interface to any source code.<\/li>\n<li>At runtime this feature allows a Python package to work at a defined time for any functional script.<\/li>\n<\/ul>\n<h3 id=\"sample-code-2\" style=\"text-align: justify;\"><strong>Sample Code<\/strong><\/h3>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-python code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-python code-embed-code\"># importing the package  <br\/>import math  <br\/># printing a statement  <br\/>print(&quot;We have imported the math package&quot;)  <\/code><\/pre> <\/div>\n<h3 id=\"output-2\" style=\"text-align: justify;\"><strong>Output<\/strong><\/h3>\n<p style=\"text-align: justify;\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4676\" src=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/packages.png\" alt=\"\" width=\"1443\" height=\"170\" srcset=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/packages.png 1443w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/packages-300x35.png 300w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/packages-1024x121.png 1024w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/packages-768x90.png 768w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/packages-390x46.png 390w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/packages-820x97.png 820w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/packages-1180x139.png 1180w\" sizes=\"(max-width: 1443px) 100vw, 1443px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is often that programmers and many coders may confuse between a module and a package. Generally, arises when it becomes hard to identify when and where a package or module should be implemented. In python programming language module and packages will make it easy for the programmers to work more professionally while dealing with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5608],"tags":[18095,18094,18100,18091,18096,18092,18098,18093,18099,18097],"class_list":["post-4674","post","type-post","status-publish","format-standard","hentry","category-python","tag-difference-between-python-modules-and-packages","tag-modules-and-packages","tag-modules-and-packages-in-python","tag-modules-vs-packages-in-python","tag-packages-in-python-with-example","tag-python-modules-and-packages","tag-python-modules-and-packages-list","tag-what-are-modules-and-packages-in-python","tag-what-is-module-in-python","tag-what-is-packages-in-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What are modules and packages in Python ? - Modules Vs Packages<\/title>\n<meta name=\"description\" content=\"What are modules and packages in Python ? - It is often that amateur programmers and many coders may confuse between a module and a package.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are modules and packages in Python ? - Modules Vs Packages\" \/>\n<meta property=\"og:description\" content=\"What are modules and packages in Python ? - It is often that amateur programmers and many coders may confuse between a module and a package.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-13T10:19:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-13T10:20:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules.png\" \/>\n<meta name=\"author\" content=\"webmaster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webmaster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/\"},\"author\":{\"name\":\"webmaster\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\"},\"headline\":\"What are modules and packages in Python ?\",\"datePublished\":\"2022-08-13T10:19:38+00:00\",\"dateModified\":\"2022-08-13T10:20:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/\"},\"wordCount\":227,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/modules.png\",\"keywords\":[\"difference between python modules and packages\",\"modules and packages\",\"modules and packages in python\",\"modules vs packages in python\",\"packages in python with example\",\"python modules and packages\",\"python modules and packages list\",\"what are modules and packages in python\",\"what is module in python\",\"what is packages in python\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/\",\"name\":\"What are modules and packages in Python ? - Modules Vs Packages\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/modules.png\",\"datePublished\":\"2022-08-13T10:19:38+00:00\",\"dateModified\":\"2022-08-13T10:20:37+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\"},\"description\":\"What are modules and packages in Python ? - It is often that amateur programmers and many coders may confuse between a module and a package.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/python\\\/what-are-modules-and-packages-in-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/modules.png\",\"contentUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/modules.png\",\"width\":1434,\"height\":169},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\",\"name\":\"webmaster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"caption\":\"webmaster\"},\"sameAs\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\"],\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/author\\\/webmaster\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are modules and packages in Python ? - Modules Vs Packages","description":"What are modules and packages in Python ? - It is often that amateur programmers and many coders may confuse between a module and a package.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/","og_locale":"en_US","og_type":"article","og_title":"What are modules and packages in Python ? - Modules Vs Packages","og_description":"What are modules and packages in Python ? - It is often that amateur programmers and many coders may confuse between a module and a package.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/","og_site_name":"Wikitechy","article_published_time":"2022-08-13T10:19:38+00:00","article_modified_time":"2022-08-13T10:20:37+00:00","og_image":[{"url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules.png","type":"","width":"","height":""}],"author":"webmaster","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webmaster","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/"},"author":{"name":"webmaster","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"headline":"What are modules and packages in Python ?","datePublished":"2022-08-13T10:19:38+00:00","dateModified":"2022-08-13T10:20:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/"},"wordCount":227,"commentCount":0,"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules.png","keywords":["difference between python modules and packages","modules and packages","modules and packages in python","modules vs packages in python","packages in python with example","python modules and packages","python modules and packages list","what are modules and packages in python","what is module in python","what is packages in python"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/","name":"What are modules and packages in Python ? - Modules Vs Packages","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules.png","datePublished":"2022-08-13T10:19:38+00:00","dateModified":"2022-08-13T10:20:37+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"description":"What are modules and packages in Python ? - It is often that amateur programmers and many coders may confuse between a module and a package.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-are-modules-and-packages-in-python\/#primaryimage","url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules.png","contentUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/modules.png","width":1434,"height":169},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4","name":"webmaster","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","caption":"webmaster"},"sameAs":["https:\/\/www.wikitechy.com\/interview-questions"],"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=4674"}],"version-history":[{"count":2,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4674\/revisions"}],"predecessor-version":[{"id":4678,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4674\/revisions\/4678"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=4674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=4674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=4674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}