Question: One of the below programs that when called like this (with the underscore representing a digit from 1 to 4) generates this output: >>> mixem_(we

One of the below programs that when called like this (with the underscore representing a digit from 1 to 4) generates this output:

>>> mixem_("we hold these truths")

'w.e. .h.o.l.d. .t.h.ese truths'

Which one?

• def mixem1(astring): mix = for index in range (0,len(astring), 2): mix = mix + astring[index] mix = mix +

def mixem1(astring): mix = for index in range (0,len(astring), 2): mix = mix + astring[index] mix = mix + "-" for index in range (len(astring)/2,len (astring)): mix = mix + astring[index] return mix def mixem2 (astring): mix = "" for index in range (0,len(astring)/2): mix = mix + astring[index]+"." for index in range (len(astring)/2,len(astring)): mix = mix + astring[index] return mix def mixem3(astring): mix = "" for index in range (0,len(astring)/2,2): mix = mix + astring[index] mix = mix + "-" for index in range (1,len(astring),2): mix = mix + astring[index] return mix def mixem4 (astring): mix = for index in range (len(astring)/2,0,-1): mix = astring[index]+mix + astring[index] return mix

Step by Step Solution

3.42 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

mixemwe hold the... View full answer

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 Introduction to Computing and Programming in Pytho Questions!