Saved Bookmarks
| 1. |
Write a program to add a prefix text to all the lines in a string? |
|
Answer» import text = “‘Strings are immutable. Slice is a substring of a main string. Stride is a third argument in slicing operation'” text_without_lndentation= textwrap.dedent (text) wrapped = extwrap.fill (text_without_Indentation, width = 50) print (textwrap.indent(wrapped, ‘*’) print () Output:
|
|