Skip to content

Commit

Permalink
modules stuff added
Browse files Browse the repository at this point in the history
  • Loading branch information
mraza007 committed Jan 12, 2019
1 parent 52c7745 commit 1990dec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions markdown-version/modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Modules
Python modules allows us to reuse our own code or sometimes use somebody else's code.
We can write our own modules or we can use modules written by someone else like `requests`,`datetime` and `etc`.

**Note**: It's just a `python` file.

## Built-in Modules
There built-in python modules that come by default.
List can be found here [LIST OF MODULES](https://docs.python.org/3/py-modindex.html)

- We can import modules by using `import` keyword
- We can also give modules an `alias` when we have long module names like `import random as r`.
- We can also import few functions from the modules `from random import randint`.
- If you want to import everything from random we do something like this `from random import *`

## Custom Modules
Custom module is just file with python code.

0 comments on commit 1990dec

Please sign in to comment.