Question: -- | Write a function, called greet, that takes a string representing a -- | persons name and says Hi to that person. --

-- | Write a function, called greet, that takes a string representing a

-- | persons name and says "Hi " to that person.

-- | There has to be only a single space between Hi and the person's name in the result string.

-- | There should not be any other spaces in the result string.

-- | There should not be any punctuation marks or any additional characters.

-- | If the name provided is empty, your function should return "Hi there".

-- -- >>> greet "Ann" -- "Hi Ann"

-- >>> greet "Peter" -- "Hi Peter"

-- >>> greet "" -- "Hi there"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!