prog4_22.py

num = float(input("実数は?"))
print(f"{num:g}")

# プログラム4-22(汎用表現)