Pythonはいわゆるオブジェクト指向言語のひとつで、処理をまとめて管理してモジュールとして保存し、他のモジュールから読み込むことで管理を容易にすることができます。
モジュールとはつまり保存したPyファイル、または予め用意された初期状態では読み込まれていない機能のことです。
モジュールの読み込み

このように複数のモジュールを作り、リンクさせることで、たとえば「ネットに接続する」「接続したサイトで何かする」「取得したデータを保存する」といった各機能をモジュールごとに管理し、可読性を高めてデバッグを用意にすることができます。

モジュールを読み込むには、importの後にモジュール名を記載すればOKです。
importはコードの先頭で行うのが一般的です。
importはコードの先頭で行うのが一般的です。
読み込んだモジュールの関数を実行

読み込んだモジュール内に関数やメソッドがある場合、読み込んだ側のモジュールでも使用することができます。
test2(読み込まれるモジュール)のほうで簡単な命令を作成し、defで関数化しておきます。
test2(読み込まれるモジュール)のほうで簡単な命令を作成し、defで関数化しておきます。

test(読み込むモジュール)のほうではtest2をimportし、モジュール名.コードという形で入力します。今回は関数なので、最後に()を付けます。

実行すると、testでtest2の関数が実行されることが確認できます。
読み込んだモジュールの変数を使用

読み込まれるモジュールtest2に変数を設定しておきます。変数は関数外でも問題ありません。

読み込むモジュールtestでその変数を使用する関数を実行すると、

変数を使用した関数の内容を出力できることが確認できます。

関数を経由しないでも、変数を直接使用することもできます。変数であれば内容を書き換えることもできますし(定数は不可)、

print(test2.a)のようにすれば、読み込んだモジュールの変数の内容を直接出力することもできます。
組み込みモジュール
ここまでは自作のモジュールで試してみましたが、Pythonには初期状態では読み込まれない機能が色々積まれた組み込みモジュールがデフォルトでいくつか用意されています(動作を軽くするため、デフォルトでは使えなくなっています)。
リンク先でなんたらモジュールと紹介されてるのがそうなんですが、
リンク先でなんたらモジュールと紹介されてるのがそうなんですが、

たとえばmathモジュールを読み込んでみます。
リンク先でモジュールにある関数などが一覧で紹介され、使い方なども解説されています。
リンク先でモジュールにある関数などが一覧で紹介され、使い方なども解説されています。

あとはおんなじです。mathモジュールのpi定数を取得すれば円周率が得られますし、

mathモジュールのsqrt関数を使えば引数の平方根が取得できます。

Python操作方法、関数・メソッドリファレンス
使用用途別にまとめたPythonリファレンスページです。
初期準備、基本概念
ダウンロード、インストール、起動
ShellとEditor、保存、実行
保存したPythonの起動
コメント、docstring、行またぎ
コメント、...
コメント