Hello I will Write All State of text with upper and lower mode one by one and i can do it by nested for but its just useful for text with 6 charector i will convert it to Recursive can anyone help?
text=['a','b','c','d','e','f']
for i in [0, 1]:
if i == 1:
text[0] = text[0].upper()
else:
text[0] = text[0].lower()
for j in [0, 1]:
if j == 1:
text[1] = text[1].upper()
else:
text[1] = text[1].lower()
for w in [0, 1]:
if w == 1:
text[2] = text[2].upper()
else:
text[2] = text[2].lower()
for q in [0, 1]:
if q == 1:
text[3] = text[3].upper()
else:
text[3] = text[3].lower()
for z in [0, 1]:
if z == 1:
text[4] = text[4].upper()
else:
text[4] = text[4].lower()
for g in [0, 1]:
if g == 1:
text[5] = text[5].upper()
else:
text[5] = text[5].lower()
print(''.join(text))
The Output is in Below and its Correct but I will do it with Recursive :
abcdef abcdeF abcdEf abcdEF abcDef abcDeF abcDEf abcDEF abCdef abCdeF abCdEf abCdEF abCDef abCDeF abCDEf abCDEF aBcdef aBcdeF aBcdEf aBcdEF aBcDef aBcDeF aBcDEf aBcDEF aBCdef aBCdeF aBCdEf aBCdEF aBCDef aBCDeF aBCDEf aBCDEF Abcdef AbcdeF AbcdEf AbcdEF AbcDef AbcDeF AbcDEf AbcDEF AbCdef AbCdeF AbCdEf AbCdEF AbCDef AbCDeF AbCDEf AbCDEF ABcdef ABcdeF ABcdEf ABcdEF ABcDef ABcDeF ABcDEf ABcDEF ABCdef ABCdeF ABCdEf ABCdEF ABCDef ABCDeF ABCDEf ABCDEF
Pleas Can Anyone Help?