Define a function called skipstring that takes a string


Define a function called skip_string() that takes a string (call it string) and an optional positive integer (call it skip_amount). The function should return a string that starts with the first character in string, and then skips skip_amount characters forward for the next character (until it runs out of characters in string). If skip_amount is omitted, it should default to skipping every other character.

So for example, skip_string("louisiana",2) should return "lia", skip_string("north carolina",3) should return "nhrn", and skip_string("alabama") should return "aaaa".

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Define a function called skipstring that takes a string
Reference No:- TGS02203238

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)