我想编写一个程序,它需要一个字符串,比如说"Fox"
,然后它会显示:
fox, Fox, fOx, foX, FOx, FoX, fOX, FOX
到目前为止我的代码:
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
到目前为止的输出:
Enter String: fox
Fox
fOx
foX
>>>