1# random integer
2integer = -20
3print('Absolute value of -20 is:', abs(integer))
4
5#random floating number
6floating = -30.33
7print('Absolute value of -30.33 is:', abs(floating))
1# random integer
2integer = -20
3print('Absolute value of -20 is:', abs(integer))
4
5#random floating number
6floating = -30.33
7print('Absolute value of -30.33 is:', abs(floating))
8
9Results
10Absolute value of -20 is: 20
11Absolute value of -30.33 is: 30.33
12