<jupyter_start><jupyter_text>OverviewPython comes with many built-in functions, but what if we want something a little specialized? Libraries offer us a collection of functions in a compact manner. They also offer different variable types which might not be available otherwise.  Questions- How can I use software that other people have written?- How can I find out what that software does? Objectives- Explain what software libraries are and why programmers create and use them.- Write programs that import and use libraries from Python’s standard library.- Find and read documentation for standard libraries interactively (in the interpreter) and online.  Code  A program must import a library module before using it.<jupyter_code>import math
print("pi is", math.pi)
print("Cos(pi) is", math.cos(math.pi))
pi = 3.14
print(pi)
print(math.pi)<jupyter_output>3.14
3.141592653589793<jupyter_text>Use help to learn about the contents of a library module.<jupyter_code>help(math)<jupyter_output>Help on module math:

NAME
    math

MODULE REFERENCE
    https://docs.python.org/3.7/library/math
    
    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    This module is always available.  It provides access to the
    mathematical functions defined by the C standard.

FUNCTIONS
    acos(x, /)
        Return the arc cosine (measured in radians) of x.
    
    acosh(x, /)
        Return the inverse hyperbolic cosine of x.
    
    asin(x, /)
        Return the arc sine (measured in radians) of x.
    
    asinh(x, /)
        Return the inverse hyperbolic sine of x.
    
    atan(x, /)
        Return the arc tangent (measured in radians) of x.
    
    atan2(y, x, /)
        Return the arc tangent (measured[...]<jupyter_text>Import specific items from a library module to shorten programs.<jupyter_code>from math import cos, pi
print("cos(pi)", cos(pi))
pi<jupyter_output><empty_output><jupyter_text>Create an alias for a library module when importing it to shorten programs.<jupyter_code>import math as m
print("cos(pi) is", m.cos(m.pi))<jupyter_output>cos(pi) is -1.0
{'fraction_non_alphanumeric': 0.06881903143585387, 'fraction_numerical': 0.011469838572642312, 'mean_word_length': 3.7672064777327936, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 1, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '234134', 'license': 'MIT', 'n_tokens_mistral': 695, 'n_tokens_neox': 656, 'n_words': 286, 'path': 'lessonNotebooks/1.06 Libraries.ipynb', 'repo_name': 'crowegian/SummerFellowsDBMIWorkshopMaterials', 'size': '2354'}