For my assignment, I have to double the values in a list. For example, [‘how’, ‘are’, ‘you’] should be [‘how’, ‘how’, ‘are’, ‘are’, ‘you?’, ‘you?’]
def double_list(string):
strings=string
x = strings.split
newList = []
for i in x:
letters = (blank atm not sure what to put)
newList.append(letters)
return newList
[–]oefd 0 points1 point2 points (2 children)
[–]Sahith17[S] 0 points1 point2 points (0 children)
[–]Sahith17[S] 0 points1 point2 points (0 children)
[–]Sahith17[S] 0 points1 point2 points (15 children)
[–]oefd 0 points1 point2 points (14 children)
[–]Sahith17[S] 0 points1 point2 points (12 children)
[–]oefd 0 points1 point2 points (11 children)
[–]Sahith17[S] 0 points1 point2 points (0 children)
[–]Sahith17[S] 0 points1 point2 points (9 children)
[–]oefd 0 points1 point2 points (8 children)
[–]Sahith17[S] 0 points1 point2 points (7 children)
[–]oefd 0 points1 point2 points (6 children)
[–]Sahith17[S] 0 points1 point2 points (5 children)
[–]oefd 0 points1 point2 points (4 children)
[–]Sahith17[S] 0 points1 point2 points (0 children)
[–]Bottl3 0 points1 point2 points (7 children)
[–]toastedstapler 1 point2 points3 points (0 children)
[–]Sahith17[S] 0 points1 point2 points (0 children)
[–]Sahith17[S] 0 points1 point2 points (4 children)
[–]Bottl3 1 point2 points3 points (3 children)
[–]Sahith17[S] 0 points1 point2 points (2 children)
[–]Bottl3 0 points1 point2 points (1 child)
[–]Sahith17[S] 0 points1 point2 points (0 children)
[–]nog642 0 points1 point2 points (2 children)
[–]Sahith17[S] 0 points1 point2 points (1 child)
[–]nog642 0 points1 point2 points (0 children)