Skip to content

Commit 4bd370a

Browse files
author
Alfredo Miranda
committed
Added double_char.py
1 parent 80b99f5 commit 4bd370a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python/string-2/double_char.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Given a string, return a string where for every char in the original, there
2+
# are two chars.
3+
def double_char(str):
4+
str2 = []
5+
for c in str:
6+
str2.append(2*c)
7+
8+
return "".join(str2)

0 commit comments

Comments
 (0)