Question: def exercise_6(a): Assume a' is a positive integer Return a string Goal: Return the string 'hello' repeated 'a' times alternating between the characters'' and '-'

 def exercise_6(a): Assume a' is a positive integer Return a string

def exercise_6(a): Assume a' is a positive integer Return a string Goal: Return the string 'hello' repeated 'a' times alternating between the characters'' and '-' between each 'hello' Hint: if a' is 3 you should return either 'hello_hello-hello' or 'hello-hello_hello'. Hint 2: Do not start or end your string with '_' or '- II II II ### BEGIN SOLUTION ### END SOLUTION [ ] assert exercise_6(2) == 'hello_hello' or exercise_6(2) == 'hello-hello' assert exercise_6(5) == 'hello-hello_hello-hello_hello' or exercise_6(5) == 'hello_hello-hello_hello-hello' assert exercise_6(1) == 'hello

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!