Total Post:113


 404  View(s)
Rate this:

What is the Python module ? How to use this ?

  1. Re: Module

    Consider a module to be the same as a code library. A file containing a set of functions you want to include in your application. 

    Create a Module : 

    def greeting(mindstick): 
      print("Hello, " + mindstick)

    import mymodule :


    Variables in Module : 

    The module having functions as already described,but also variables of all types(arrays, dictionaries, objects etc): 

    person1 = { 
      "name": "Prakash",
      "age": 19,
      "country": "India"

    Built-in Modules : 

    built-in modules in Python,which you can import whenever. 

    import platform 
    x = platform.system()

    Import From Module :

    You can choose to import only parts from a module,by using the from keyword. one function and one dictionary: 

    def greeting(mindstick): 
      print("Hello, " + mindstick)
    person1 = {
      "name": "praksh",
      "age": 19,
      "country": "India"

      Modified On Jul-06-2018 01:31:41 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.