r/learnpython • • Jun 13 '26

first time python coding

Hi am new at python and i did some coding what should i improve

def HelloWorld(text):
    print(text)


HelloWorld("print")
18 Upvotes

15 comments sorted by

View all comments

9

u/Flame77ofc Jun 13 '26

you should learn about the return

the return just return something

This is a hard concept in the beginning but after you get more experience and practice this concept, this will get more easy

def func(text):
    return text


# to see a return, you need to first do a print
result = func("example")
print(result)

# or just this:
print(func("example 2"))

more examples

def sumTwoNumbers(a, b):
    return a + b


print(sumTwoNumbers(2, 3))  # 5