Loading…
Functions are reusable blocks of code.
def function_name():
# code here
passCall the function
function_name()
def greet():
print("Hello!")greet() # Prints: Hello!
Create a function called say_hello that prints "Hello, Python!" then call it.
Downloading Python… (one-time, ~10 MB)
This runs entirely in your browser and is cached for next time.