November 28th, 2012, 01:36 AM
Write a short function using the functional programming features of Python
that takes a list of strings (say all of equal length) and creates one string
c00 , c10 , · · · , cn0 , c01 , c11 , · · · , cn1 , · · · , where cij is the j th character of the
ith string in the list. In other words form a string by taking the first
character of each string in the list, then the second character of each
string, etc. in that order and concatenating all of them to form the out-
put string. Example: on an input of [abc, pqr, 123, 456] it must
return ap14bq25cr36. Bonus marks if you manage you to do this with-
out assuming that all the strings are of equal length
November 28th, 2012, 11:38 AM
Oooh! This is a good application for itertools.zip_longest.
I'd employ string methods as well.
If the assignment is due within the hour you might pass if you're able to demonstrate that you understand the question and explain "functional programming features of Python".
[/code] are essential for python code and Makefiles!