Write a function twins that takes a string as input, and returns a copy of the string where every character is repeated twice
Input: "abc"
Output: "aabbcc"
Input: "a"
Output: "aa"
Input: ""
Output: ""
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
output:''
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
output:''
elem
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
output:'aa'
elem
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
output:'aa'
elem
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
output:'aabb'
elem
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
output:'aabb'
elem
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
output:'aabbcc'
elem
def twins(input):
output = ''
for elem in input:
output = output + elem + elem
return output
'abc'
output:'aabbcc'
def twins(input):
output = ''
for elem in input:
output = elem + elem
return output
'abc'
def twins(input):
output = ''
for elem in input:
output = elem + elem
return output
'abc'
output:''
def twins(input):
output = ''
for elem in input:
output = elem + elem
return output
'abc'
output:''
elem
def twins(input):
output = ''
for elem in input:
output = elem + elem
return output
'abc'
output:'aa'
elem
def twins(input):
output = ''
for elem in input:
output = elem + elem
return output
'abc'
output:'aa'
elem
def twins(input):
output = ''
for elem in input:
output = elem + elem
return output
'abc'
output:'bb'
elem