from math import pi, sqrt G = 9.8 L = float(input("振り子の長さは何メートル?")) t = 2 * pi * sqrt(L / G) print(f"周期は{t:#.2g}秒です") # プログラム5-11(振り子の周期)