From a9d50cc0f449b2b910075f1f2b04f4d7c75949f5 Mon Sep 17 00:00:00 2001 From: Qasim Umar <111963035+HappyDistributer@users.noreply.github.com> Date: Sat, 18 Feb 2023 23:04:10 +0500 Subject: [PATCH] Update 021_Text_Wrap.md --- solutions/021_Text_Wrap.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/solutions/021_Text_Wrap.md b/solutions/021_Text_Wrap.md index 00fbe97..eef3f49 100644 --- a/solutions/021_Text_Wrap.md +++ b/solutions/021_Text_Wrap.md @@ -83,3 +83,14 @@ if __name__ == '__main__': result = wrap(string, max_width) print(result) ``` +## 2nd solution +'''python +import textwrap + +def wrap(string, max_width): + return textwrap.fill(string, max_width) + +if __name__ == '__main__': + string, max_width = input(), int(input()) + result = wrap(string, max_width) + print(result)