import math
x = float(input(">>>"))
if x >= 3:
y = math.e ** x + x ** 0.5
elif x == 0:
y = math.sin(x) + math.log2(1 + x)
else:
y = -1
y = f"{y:.2f}"print(y)
weixin_39821605的博客python分段函数如何编写?python编写分段函数的方法:1.绘制分段函数:y=4sin(4πt)-sgn(t-0.3)-sgn(0.72-t)代码:#!/usr/bin/python# -*- coding:utf-8 -*-import numpy as npimport matplotlib.pyplot as plt#绘制...