<jupyter_start><jupyter_text>Python Modulesfunctions that help us to achieve code reusability cmath module for complex numbersmath module for arithmatical, logarithmic operations on numbers whicg are not complex<jupyter_code>import math
#print(factorial(5))-this line will throw error as we need to include math package i.e, math.factorial
print(math.factorial(5))
#renamed factorial as fact 
from math import factorial as fact
print(fact(6))
print(math.floor(15/2))
print(math.gcd(3,15))
#by default base is e i.e, math.e which is constant
print(math.log(math.e))
#need to specify base in other case like her base is 2
print(math.log(16,2))
#it supports +inf and -inf
print(math.inf)
print(-math.inf)
print(math.pi)
print(sum([1,2,3,4,5]))
print(max([3,5,7,9,0]))<jupyter_output>720
7
3
1.0
4.0
inf
-inf
3.141592653589793
15
9<jupyter_text>Sys modules help us to provide access to variables and functions related to system or python interpreter it helps us to find current directory, windows version, command line arguments argvit gives list of command line arguments<jupyter_code>import sys
def printData():
    print(sys.argv)
printData()

#sys.argv prints the argv[0] which is filename ie. jupyter notebook location we can pass more command 
#line arguments while running on console like python PythonModules.ipynb 10 20 30
# here 10 is argv[1]
# 20 is argv[2]
# 30 is argv[3]
#sys.argv will print all if given on console
def printSum():
    print(int(sys.argv[1])+int(sys.argv[2]))
#printSum() 
print(sys.version)
#interpreter will search for packages in these paths.
print(sys.path)
#maxsize- maximum memory that a data-structure can take in python
#maxint- maximum integer that we can make in python
#stdin,#stdout,#stderr-file system objects
#python documentation have more info on these modules
print(type(sys.stdin))
print(sys.stdout)
print(sys.maxsize)<jupyter_output><class '_io.TextIOWrapper'>
<ipykernel.iostream.OutStream object at 0x7f07a4da5c90>
9223372036854775807
{'fraction_non_alphanumeric': 0.09434914228052473, 'fraction_numerical': 0.04843592330978809, 'mean_word_length': 5.791095890410959, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '244828', 'license': 'MIT', 'n_tokens_mistral': 693, 'n_tokens_neox': 647, 'n_words': 236, 'path': '2.Python/PythonModules.ipynb', 'repo_name': 'sgeek28/Data-Science', 'size': '1982'}