I need help with functions and for loops (original) (raw)

i just don’t understand functions or for loops…

bluej (jayden) May 3, 2025, 12:09am 2

every time i try to use a function it says something like

<function hi at 0x000002C619F91800>

bluej (jayden) May 3, 2025, 12:09am 3

and for loops just don’t make sense

MRAB (Matthew Barnett) May 3, 2025, 12:13am 4

That means you’re not calling the function, you’re just referring to it.

For example:

def hi():
    print('Hello')

# This prints a reference to the function:
print(hi)

# This actually calls the function:
hi()

# This calls the function and then prints what it returned:
print(hi())

bluej (jayden) May 4, 2025, 8:29pm 5

thanks
it worked :smile: