Actions

Functions

From Jedisaber Wiki

Revision as of 00:36, 27 June 2025 by Admin (talk | contribs) (Created page with "A function is a block of code that only runs when it is called. You can pass data to a function. A function can return data as a result. You can create a function by defining it: <code> def my_function(): print("Hello from a function") </code> ... and call it thusly: <code> my_function() </code>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A function is a block of code that only runs when it is called.

You can pass data to a function.

A function can return data as a result.

You can create a function by defining it:

def my_function():

print("Hello from a function")

... and call it thusly:

my_function()