Start learning free

LESSON 41 OF 673 · FUNCTIONS I

Exercise: Create Function with Parameters in Python

Practice

We've written this code:

print("My name is Andy")
print("I code in Python")
print("I have a dog")

print("My name is Mike")
print("I code in Java")
print("I have a cat")

print("My name is Sarah")
print("I code in JavaScript")
print("I have a parrot")

Write the same code in a better way by creating and calling a function with parameters print_messages()

STEP 1 OF 5
    Ctrl + Enter to check