We've written this code:
func mainFunction() {
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 printMessages()
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check