I am a beginner in Python trying to make a function that will capitalize all of the values with an even index, and make lowercase all of the values with an odd index.
I have been struggling repeatedly with for loops only giving me the first value. I have also tried with while loops. However I am curious if there is a way to make it work with for loops (do I need a '+=1' somewhere?)
def func1(x):
for (a,b) in enumerate (x):
if a%2 == 0:
return b.upper()
else:
return b.lower()
func1('Testing Testing')
>>>'T'