i started studying programming , school assignment have make program in python asks user input integer , calculates absolute value of that. know abs
function. cant figure out how assign users input abs
function.
i write:
a = int (raw_input ("give number")) int = abs()
the school assignment:
write program calculates absolute value of number. is, absolute value of -15 15, absolute value of 10 10, etc.
are trying a = math.abs(a)
? assign abs value of a.
full code:
import math = int(input("input number")) = math.abs(a) print(a)
Comments
Post a Comment