pycharm - why does my function is returning data type None??: Python datatype None -
this python code printing absolute number. function returning type none
. not getting have done wrong. please me.
def n(num): if num<0: return (num*-1) no = input("enter number: ") print "absolute value is: " print n(no)
def n(num): if num<0: return (num*-1) else: return num no = input("enter number: ") print "absolute value is: " print n(no)
writing else statement return num >= 0
thank :)
Comments
Post a Comment