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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -