Skip to content

Commit 79fd349

Browse files
committedFeb 21, 2023
feat: add "Strings" solution
1 parent 0ee2956 commit 79fd349

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎text_wrap.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import textwrap
2+
3+
4+
def wrap(string, max_width):
5+
new_s = ""
6+
for i in range(0, len(string), max_width):
7+
new_s += string[i : i + max_width] + "\n"
8+
9+
return new_s
10+
11+
12+
if __name__ == "__main__":
13+
string, max_width = input(), int(input())
14+
result = wrap(string, max_width)
15+
print(result)

0 commit comments

Comments
 (0)
Please sign in to comment.