Repeat message n times
Exercise Type: Implementation
Instructions
Part 1
Write a bit of code that prints My awesome message
to the console as many times as you want (n
)!
Part 2
name: | RepMessage() |
argument(s): | x (character) : the message |
n numeric : the number of times the message is repeated | |
return: | - |
Part 3
Test your new function with the following calls:
RepMessage(x="Coolness", n=5) # should repeat 5 times
RepMessage(x="Nope!", n=0) # should not print anything
Think of arguments with which things can go really wrong! How should we handle those?