prog7_1.py

def abs_value(x):
    if x < 0:
        x = -x
    return x

answer = abs_value(-3.5)
print("答えは", answer)

# プログラム7-1(関数の定義と使用 ①)