Python:用户在键盘输入任意字符串,将其中的字母转为大写输出。

【问题描述】用户在键盘输入任意字符串,将其中的字母转为大写输出。

【输入形式】
【输出形式】
【样例输入】d,lbhh904igj5n/=2

【样例输出】DLBHHIGJN

【样例说明】
【评分标准】
利用upper()函数和正则表达式

import re 
print(''.join(x.upper() for x in re.findall(r'[a-z]',input())))

猜你喜欢

转载自blog.csdn.net/missionnn/article/details/120450547