📜  绝对值python代码示例

📅  最后修改于: 2022-03-11 14:45:32.690000             🧑  作者: Mango

代码示例2
#find the absolute or modulous of the  number
a=int(input('enter number'))
if a>0:
    print('The absolute value of',a,'is',a)
else:
    print('The absolute value of',a,'is',-a)
#output:
#case I
enter number4
The absolute value of 4 is 4
#case II
enter number-4
The absolute value of -4 is 4