Jan-13-2017, 01:54 PM (This post was last modified: Jan-13-2017, 02:08 PM by Kebap. Edited 1 time in total.

*Edit Reason: removed x-large fonts...*) Implement a function that, given a feedback

and the size of the screen, splits the feedback

into lines so that:

I have to complete this function by filling up the ... spaces.

For

and the size of the screen, splits the feedback

into lines so that:

- each token (i.e. sequence of non-whitespace characters) belongs to one of the lines entirely;

- each line is at most size characters long;

- no line has trailing or leading spaces;

- each line should have the maximum possible length, assuming that all lines before it were also the longest possible length.

I have to complete this function by filling up the ... spaces.

import ... def feedbackReview(feedback, size): return ...Examples:

For

feedback = "This is an example feedback"and

size = 8the output should be

feedbackReview(feedback, size) = ["This is", "an", "example", "feedback"]Thank you.