I want to write a program that would take a string, let's say "Fox"
, then it would display:
fox, Fox, fOx, foX, FOx, FoX, fOX, FOX
My code so far:
string = raw_input("Enter String: ")
length = len(string)
for i in range(0, length):
for j in range(0, length):
if i == j:
x = string.replace(string[i], string[i].upper())
print x
Output so far:
Enter String: fox
Fox
fOx
foX
>>>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…