How can i print and return a value from a function in python? -
i cant figure out how make return value function return , print, example
def exe(a,b): if == b: return 1
how 1 print return? in advance. know stupid question , pretty useless, im pretty sure can done , not knowing how driving me nuts.
you can have multiple statements, "return" ends function.
print statement when combined expressions (the stuff right of it) (in python 2) sends expressions standard out, (stdout), typically console. in python 3, print function, , it's preferable use print function in modern python.
so want print come before return.
def exe(a,b): if == b: print(1) return 1
Comments
Post a Comment