Python’s interactive shell comes with a lot of built-in functions, so we already know that. Because they’re part of the shell, functions like these are always ready to use: print () and input () for I/O (input/output), functions for converting numbers like int (), float (), complex (), functions for converting data types such as list (), tuple (), set (), etc.
In addition to these many built-in functions, there are also a lot of pre-made functions that come with Python distributions. These modules are called built-in modules because they have these functions already built into them.
They are written in C language and are part of the Python shell.
If you want to see a list of all of the available modules in Python Programming Language, you can ask Python to tell you. Type in the following code in the Visual studio code:
help('modules')
The output to the above code is shown below:
Please wait a moment while I gather a list of all available modules...
pygame 2.1.0 (SDL 2.0.16, Python 3.10.1)
Hello from the pygame community. https://www.pygame.org/contribute.html
__future__ _testbuffer fnmatch quopri
_abc _testbuffer_d fractions random
_aix_support _testcapi ftplib re
_ast _testcapi_d functools reprlib
_asyncio _testconsole gc rlcompleter
_asyncio_d _testconsole_d genericpath runpy
_bisect _testimportmultiple getopt sample
_blake2 _testimportmultiple_d getpass sched
_bootsubprocess _testinternalcapi gettext secrets
_bz2 _testinternalcapi_d glob select
_bz2_d _testmultiphase graphlib select_d
_codecs _testmultiphase_d gzip selectors
_codecs_cn _thread hashlib setuptools
_codecs_hk _threading_local heapq shelve
_codecs_iso2022 _tkinter hello shlex
_codecs_jp _tkinter_d hmac shutil
_codecs_kr _tracemalloc html signal
_codecs_tw _uuid http site
_collections _uuid_d idlelib smtpd
_collections_abc _warnings imaplib smtplib
_compat_pickle _weakref imghdr sndhdr
_compression _weakrefset imp socket
_contextvars _winapi importlib socketserver
_csv _xxsubinterpreters inspect sqlite3
_ctypes _zoneinfo io sre_compile
_ctypes_d _zoneinfo_d ipaddress sre_constants
_ctypes_test abc itertools sre_parse
_ctypes_test_d aifc json ssl
_datetime antigravity keyword stat
_decimal argparse lib2to3 statistics
_decimal_d array linecache string
_distutils_hack ast locale stringprep
_elementtree asynchat logging struct
_elementtree_d asyncio lzma subprocess
_functools asyncore mailbox sunau
_hashlib atexit mailcap symtable
_hashlib_d audioop marshal sys
_heapq base64 math sysconfig
_imp bdb mimetypes tabnanny
_io binascii mmap tarfile
_json binhex modulefinder telnetlib
_locale bisect msilib tempfile
_lsprof builtins msvcrt test
_lzma bz2 multiprocessing textwrap
_lzma_d cProfile netrc this
_markupbase calendar newmodule threading
_md5 cgi nntplib time
_msi cgitb nt timeit
_msi_d chunk ntpath tkinter
_multibytecodec cmath nturl2path token
_multiprocessing cmd numbers tokenize
_multiprocessing_d code numpy trace
_opcode codecs opcode traceback
_operator codeop operator tracemalloc
_osx_support collections optparse tty
_overlapped colorsys os turtle
_overlapped_d compileall pathlib turtledemo
_pickle concurrent pdb types
_py_abc configparser peppercorn typing
_pydecimal contextlib pgzero unicodedata
_pyio contextvars pgzrun unicodedata_d
_queue copy pickle unittest
_queue_d copyreg pickletools urllib
_random crypt pip uu
_sha1 csv pipes uuid
_sha256 ctypes pkg_resources venv
_sha3 curses pkgutil warnings
_sha512 dataclasses platform wave
_signal datetime plistlib weakref
_sitebuiltins dbm poplib webbrowser
_socket decimal posixpath winreg
_socket_d difflib pprint winsound
_sqlite3 dis profile winsound_d
_sqlite3_d distutils pstats wsgiref
_sre doctest pty xdrlib
_ssl email py_compile xml
_ssl_d encodings pyclbr xmlrpc
_stat ensurepip pydoc xxsubtype
_statistics enum pydoc_data zipapp
_string errno pyexpat zipfile
_strptime faulthandler pyexpat_d zipimport
_struct filecmp pygame zlib
_symtable fileinput queue zoneinfo
Enter any module name to get more help. Or, type “modules spam” to search
for modules whose name or summary contain the string “spam”
We cannot simply use all of these many modules! In fact, I don’t know most of them myself. However, there are some useful and frequently used built-in modules of Python.
- Math Module
- Statistics Module