Skip to content

Latest commit

 

History

History
43 lines (23 loc) · 553 Bytes

Double_Char.md

File metadata and controls

43 lines (23 loc) · 553 Bytes

CodeWars Python Solutions


Double Char

Given a string, you have to return a string in which each character (case-sensitive) is repeated once.

double_char("String") ==> "SSttrriinngg"

double_char("Hello World") ==> "HHeelllloo  WWoorrlldd"

double_char("1234!_ ") ==> "11223344!!__  "

Given Code

def double_char(s):
    pass

Solution

def double_char(s):
    return "".join([c * 2 for c in s])

See on CodeWars.com