Chapter 2-2 Measurements of Function [1] python

The title claim Calcd following piecewise function f (x) is:

official

Input format:
input given real number x in a row.

Output format:
in one line by "f (x) = result" output format, wherein both x and result to one decimal place.

Input Example 1:
10

Sample Output. 1:
F (10.0) = 0.1

Input Sample 2:
0

Output Sample 2:
F (0.0) = 0.0

n=float(input())
if n==0:
    y=0
else:
    y=1/n
print("f({0:.1f}) = {1:.1f}".format(n,y))
Published 14 original articles · won praise 1 · views 96

Guess you like

Origin blog.csdn.net/weixin_45948920/article/details/104345390