Day 2 : Function Arguments & Return Values

Today I learned how to make functions more powerful by passing values into a function and returning values back from a function.
This helps make functions flexible, reusable, and cleaner.


What I Learned Today


Example Code From Day 2

# Day 2 - Function Parameters and Return Values

# This function takes a name as input and returns a greeting message
def greet(name):
    return f"Hello, {name}!"

# Calling the function
message = greet("Rekha")

print(message)

Output

Hello, Rekha!

Summary

Today I learned how functions become more useful when they accept parameters and return values:

This helps make Python code cleaner and more powerful.