python实现将字母转换为大写字母输出

t="198t2845a7293R489234S892b8347348C82923"
str1=""
for a in t:
    if a.islower():
        str1=str1+a
    elif a.isupper():
        str1=str1+a
print(str1.upper())

运行结果:

python实现将字母转换为大写字母输出_第1张图片

 

你可能感兴趣的:(python初学者,python,人工智能)