python代码输入一段字符串大小写转换
num8 = input("请输入:")for i in range(len(num8)): if ord(num8[i]) >= 97 and ord(num8[i]) <= 122:print(chr(ord(num8[i]) - 32),end = "")elif ord(num8[i]) >= 65 and ord(num8[i]) <= 90:print(chr(ord(num8[i]) + 32),end = "") else:print(num8[i],end ="")
推荐阅读
- CVE-2020-16898|CVE-2020-16898 TCP/IP远程代码执行漏洞
- python学习之|python学习之 实现QQ自动发送消息
- 逻辑回归的理解与python示例
- Node.js中readline模块实现终端输入
- python自定义封装带颜色的logging模块
- 【Leetcode/Python】001-Two|【Leetcode/Python】001-Two Sum
- Python基础|Python基础 - 练习1
- 不废话,代码实践带你掌握|不废话,代码实践带你掌握 强缓存、协商缓存!
- Python爬虫|Python爬虫 --- 1.4 正则表达式(re库)
- Python(pathlib模块)