列表索引for循环改内容大写
s = ["张无忌","武则天","刘备","abc","cba"]
for lst in range(len(s)):
x = s[lst].upper()
s[lst] = x
print(s)
Python学习经历
阅读 132
2022-12-27
s = ["张无忌","武则天","刘备","abc","cba"]
for lst in range(len(s)):
x = s[lst].upper()
s[lst] = x
print(s)
相关推荐
精彩评论(0)