Question: Have the function String Challenge (strArr) read the array of strings stored in strarr, which will contain two elements, the first some sort of

Have the function String Challenge (strArr) read the array of strings stored in strarz, which will contain

Have the function String Challenge (strArr) read the array of strings stored in strarr, which will contain two elements, the first some sort of string and the second element will be a number ranging from 1 to 6. The number represents how many rows to print the string on so that it forms a zig-zag pattern. For example: if strarr is ["coderbyte", "3"] then this word will look like the following if you print it in a zig-zag pattern with 3 rows: d ebt y Your program should return the word formed by combining the characters as you iterate through each row, so for this example your program should return the string creoebtdy. Examples Input: ["cat", "5"] Output: cat Input: ["kaamvjjfl", "4"] Output: kjajfavlm 1 2 3 4 5 6 7 8 def String Challenge (strArr): # code goes here return strArr #keep this function call here print(StringChallenge (input()))

Step by Step Solution

3.47 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The image presents a coding challenge where the function StringChallengestrArr is supposed to read in an array of strings strArr consisting of two ele... View full answer

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 Programming Questions!