NPTEL PROGRAMMING ASSIGNMENTS
The Joy of Computing using Python
Programming Exam 1 : Text Wrap
Due on 2021-10-10, 11:00 ISTGiven a string and width, write a program to convert the given string into different strings of given width separated by newline.
Input Format be Like
The first line contains a string.
The second line contains the width.
Output Format must be
Print the text wrapped paragraph.
Sample Input 0:
ABCDEFGHIJKLIMNOQRSTUVWXYZ
4
Sample Output 0:
ABCD
EFGH
IJKL
IMNO
QRST
UVWX
YZ
Given a string and width, write a program to convert the given string into different strings of given width separated by newline.
Input Format be Like
The first line contains a string.
The second line contains the width.
Output Format must be
Print the text wrapped paragraph.
Sample Input 0:
ABCDEFGHIJKLIMNOQRSTUVWXYZ
4
Sample Output 0:
ABCD
EFGH
IJKL
IMNO
QRST
UVWX
YZ