编程实现分段函数的计算,输入x值,根据分段函数计算y的值,
import math
x = float(input())
if x < 1:
print("{:.2f}".format(math.log(abs(x),2)))
elif x >= 1 and x < 10:
print("{:.2f}".format(math.exp(x)))
elif x >= 10:
print("{:.2f}".format(3 * math.sqrt(x / 3) + 10))
用到了log(),abs(),exp(),sqrt()