Functions
Create reusable blocks of code using functions.
Learn by experimenting
Study the Python code, run it, change values and observe the output. Practical experimentation is an important part of learning programming.
Python Code
Python runs directly in your browser.
def greet(name):
return 'Hello ' + name
message = greet('Alex')
print(message)
Python Output
Program output appears here.
Test your understanding
Choose the best answer.
Which Python structure stores key-value pairs?