Question: Double Word Write code that constructs a string made up of each character in a string variable named word repeated twice. For example, if word

 Double Word Write code that constructs a string made up of

Double Word Write code that constructs a string made up of each character in a string variable named word repeated twice. For example, if word contains 'Python', the resulting string would be 'PPyytthhoonn'. Store the constructed string in a variable called double_word. Assume that word has already been initialized. 3 for index in range (len (word)): 4 index = int(index) 5 if(index == len(word)-1): 6 spell_string += word[index] 7 else: 8 spell_string += (word[index] + "-") 9 print(spell_string) Check My Solution Load My Latest Solution Reset Test Results: The code does not use a variable named double_word as required. 0% of tests passed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!