Exercise 1: Greet a Person

Create a method that takes a name as an input and appends and prepends text with the name to greet the person.

Problem statement

Write a greet method that takes a name, prepends "Hello ", appends an exclamation mark, "!", and then prints the resultant string.

Example

greet("Ada")

This prints:

Hello Ada!

Try it yourself

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy