unknown
unknown

Reputation: 111

User defined function returns no output?

As a first timer, I have ran the following code on pycharm:

def help_fun(name):
print("Hi"+ name +"!, how may we help you!") 
help_fun("john") 

the output generated reads:

process finished with exit code 0. 

Nothing more, but as part of the output, is showing again. Please, may I know the reason for such an error?

However, the pycharm works perfectly when somethings as follows is ran:

def add_fun(a, b):
sum = a+b

return sum
a=15
b=45

aa=add_fun(a, b)
print(aa) 

Am I missing some package or something? Thank you.

EDIT: See attached the result even with the proper indentation enter image description here

Upvotes: 0

Views: 31

Answers (0)

Related Questions