好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

如何用Python求分段函数的值

写一段程序,输入x,输出y

x = eval(input())
y = 0
if x<1:
    y = x
elif x>=1 and x<10:
    y = 2*x-1
else:
    y = 3*x-11
print(y)

相关免费学习推荐: python视频教程

以上就是如何用Python求分段函数的值的详细内容!

查看更多关于如何用Python求分段函数的值的详细内容...

  阅读:46次