Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1: Programming exercise 1 Write a function called repeater(s1, s2, n) that given two strings s1 and s2 and an integer n returns a

image text in transcribed

Task 1: Programming exercise 1 Write a function called repeater(s1, s2, n) that given two strings s1 and s2 and an integer n returns a string that starts with an underscore ('_'), then s1 and s2 alternate n times, then ends with an underscore. (For those who know loops: you may not use loops to solve this questions.) Testing your code: Here is what the output of your function should look like when you make the following function calls: (4) repeater('AAA', 'x', 3) '_AAAXAAAXAAAX_' [5] repeater('+', '--', 30) '_+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+- repeater('T', '1_1', 100) E T1_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_17 8 Task 1: Programming exercise 1 Write a function called repeater(s1, s2, n) that given two strings s1 and s2 and an integer n returns a string that starts with an underscore ('_'), then s1 and s2 alternate n times, then ends with an underscore. (For those who know loops: you may not use loops to solve this questions.) Testing your code: Here is what the output of your function should look like when you make the following function calls: (4) repeater('AAA', 'x', 3) '_AAAXAAAXAAAX_' [5] repeater('+', '--', 30) '_+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+- repeater('T', '1_1', 100) E T1_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_lti_17 8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago